gsk3
Cadet
- Joined
- Sep 12, 2017
- Messages
- 5
I just wrote a shell script to use rclone to backup my files (script below in case someone finds it useful; nothing fancy there).
I'd like to have its output piped into the log file that's e-mailed out every day (the one that you get when you set up your email in the FreeNAS control panel). Can someone point me towards the right way to do this? I've looked around and can't find the FreeNAS logging documentation.
Can I just pipe/append stdout to /var/log/maillog?
Thanks!
#!/usr/local/bin/bash
set TRANSFERS=32
set DATE=`date +%e-%m-%y`
res=$(ps -A -ef -o comm | grep -e rclone)
if [ "$res" == "rclone" ]
then
echo "rclone currently running. Aborting backup."
else
echo "rclone not currently running. Starting backup."
rclone sync /media/myfiles BBencrypted:myfiles --transfers=32 --log-level=NOTICE --log-file=/root/rcloneLog/rcloneLog-$DATE.log --ask-password=false
fi
I'd like to have its output piped into the log file that's e-mailed out every day (the one that you get when you set up your email in the FreeNAS control panel). Can someone point me towards the right way to do this? I've looked around and can't find the FreeNAS logging documentation.
Can I just pipe/append stdout to /var/log/maillog?
Thanks!
#!/usr/local/bin/bash
set TRANSFERS=32
set DATE=`date +%e-%m-%y`
res=$(ps -A -ef -o comm | grep -e rclone)
if [ "$res" == "rclone" ]
then
echo "rclone currently running. Aborting backup."
else
echo "rclone not currently running. Starting backup."
rclone sync /media/myfiles BBencrypted:myfiles --transfers=32 --log-level=NOTICE --log-file=/root/rcloneLog/rcloneLog-$DATE.log --ask-password=false
fi