Can't execute rsync cron

asked 2015-11-19 05:45:03 -0500

alexmigf gravatar image

Hi,

I'm using user crontab -e to execute specific cron jobs on a remote server. The ones without rsync are working ok, but the rsync crons are not.

My command is like this:

20 0 * * * rsync -avzhe ssh root@00.000.00.00:/remote/directory /local/directory

If i run the command in terminal works ok, so i assume the command is ok. Also i don't have any cron log file on /var/log.

Any idea of what could be the problem?

edit retag flag offensive close merge delete

Comments

2

We can't say without seeing the error output from the journal when the job runs - but it is generally not a good idea to allow ssh access directly by the root user, and your IP is not valid. -e ssh is the default, you don't need to declare it.

randomuser gravatar imagerandomuser ( 2015-11-19 08:43:34 -0500 )edit
1

Almost all of the problems with cron are due to the fact that cron runs with a minimal shell and minimal environmental variables such as $PATH. So use the full path to commands rather then "rsync" or "ssh"

bodhi.zazen gravatar imagebodhi.zazen ( 2015-11-19 10:07:36 -0500 )edit