I noticed that cron exists on the original firmware and is running (according to ps), but I cannot get it to run a custom script I created and there are also no signs of cron in /var/log/messages
I am not very familiar with unix, so any help is appreciated.
This is what I did so far:
- created folder /var/scripts/
- created script file in /var/scripts/ "my-rsync", set chmod to 755
- content of script:
#!/bin/sh rsync -avz --delete -e ssh user@remote_server:/mnt/ToBackup/ /shares/user/Backup/ echo "rsync completed at: $(date)" >> /shares/Public/rsync.log
it is a pretty basic rsync script that connects to remote_server (with public key authentication).
The last line is for checking if the script ran through.
If I execute the script manually with root user over ssh, it works as expected and outputs the line in /shares/Public/rsync.log
- Using "crontab -e" I set up a new schedule for the script:
# m h dom mon dow command 0 3 * * 5 root /var/scripts/my-rsync #
"crontab -l" shows this content. So to my knowledge, it should execute the script every Friday at 03:00 in the morning with root user.
…but it does not do anything.
Next I noticed that there are several maintenance scripts in the /etc/cron.daily/ folder, so I just copied the script over to this directory in the hope, that it would be executed daily, but no luck there either :(
Please point out any obvious errors I made or what I could do to check the situation further.
Thank you in advance for your help