I'm trying to create a cronjob that runs the following command
sudo sh /usr/local/bin/send_site_backup_files_to_dropbox.sh |
ts "[%Y-%m-%d %H:%M:%S]" 2>&1 |
tee /var/log/send_backups_to_dropbox.log |
mailx -s "Report for Vesta backup files sent to Dropbox" [email protected]'
The command executes a script that uploads the backups from my server to my dropbox folder. It works perfectly when I run it through PuTTy . However when I run via cronjob the following error is returned to my email:
/bin/sh: -c: line 0: unexpected EOF while looking for matching '"' /bin/sh: -c: line 1: syntax error: unexpected end of file
Without this part ts "[%Y-%m-%d %H:%M:%S]" 2>&1
it works, then the problem is there.