SYNC functions will not execute when running in a cron juob

I have create a simple script to sync photos to my Amazon drive… Script is as follows…

/usr/sbin/rclone lsd amazon:/Pictures > /home/mark/backup_stuff/pictures.txt
/usr/sbin/rclone sync /mnt/freenas/Pictures amazon:/Pictures >> /home/mark/backup_stuff/pictures.txt
sendemail …

Note contents of sendemail line was remove to protect information

When executed within the cron job the “lsd” executes fine, the “sync” command does not. My log file contains no error messages of any type. I add “lsd” command just to verify that rclone was being found during execution.

If I execute the same script at command the “sync” commands execute normally…

Anyone have were I should look to as why this problem is occurring…

Thank You

You want to include stderr in the log too then that will give you a clue, so

/usr/sbin/rclone lsd amazon:/Pictures > /home/mark/backup_stuff/pictures.txt 2>&1
/usr/sbin/rclone sync /mnt/freenas/Pictures amazon:/Pictures >> /home/mark/backup_stuff/pictures.txt 2>&1
sendemail .....

Or alternatively you can use the --log-file rclone.log flag. That won’t put the output of lsd in the log though.

Thanks I will give that try…

What I found is “sync” command was actual working. With out the “2>&1” in the cron job the status of “SYNC” would not be written to the log file. Thanks to “ncw” for the suggestion of adding “2>&1”.