[clue] [TECH] rsync command runs from command line but not via cron
    Brian Gibson 
    bwg1974 at hotmail.com
       
    Wed Jun  1 12:38:52 MDT 2011
    
    
  
OK I have a pair of Drobo FS NAS devices.
Kernel  :Linux Drobo-FS 2.6.22.18
BusyBox v1.14.2 (2009-07-29 17:47:47 PDT) multi-call binary
One is the file server,
 the other is the backup device.  I can manually rsync between the two 
via the command line during a ssh session to the backup device.  It 
works if I call the rsync command directly or via the shell script that calls the rsync command.
crond is not enabled by default and there is no official DroboApp 
(marketing name for software plugin) to enable the service.  This blog 
post outlines how to 
enable crond: http://blog.troyastle.com/2010/06/activate-cron-daemon-on-drobofs.html
crond is running (ps | grep crond) and I've tested using the following cron job: 0,15,30,45 * * * * date > /path/to/test.txt
The following job does get called: 0 * * * * /path/to/backup.sh > 
/path/to/output.log (alternate definition,  0 * * * * /bin/sh 
/path/to/backup.sh > /path/to/output.log)
However, the rsync command does not run.  I only get the "BEGIN" and 
"END" messages I added in the output file.  Not even an error message.  
Calling the script from the command line produces the full output, 
starting with "receiving incremental file list".  I suspect that the 
cron environment is missing something (or I am), but adding the -l to 
the call (/bin/sh -l /root/backup.sh) has no effect.
Any ideas?
Here's the executable script with IP removed:
#!/bin/sh
echo '****************************************'
echo 'BEGIN BACKUP'
date
echo '****************************************'
# ssh uses public/private key authentication
/mnt/DroboFS/Shares/DroboApps/rsync/rsync -avz -e 'ssh -i /root/rsync-key' --rsync-path=/mnt/DroboFS/Shares/DroboApps/rsync/rsync root at 0.0.0.0:/mnt/DroboFS/Shares /mnt/DroboFS/
echo '****************************************'
echo 'END BACKUP'
date
echo '****************************************'
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue/attachments/20110601/cbf25919/attachment-0001.html 
    
    
More information about the clue
mailing list