here is the script:
#!/bin/sh export PATH=$PATH:/usr/local/bin
if [! -f /tmp/syncingcms ]
then
touch /tmp/syncingcms
/usr/bin/rsync -av -e /usr/bin/ssh --exclude '*.svn*' thecoolone@vtu.org:/var/www/vtu/info.vtu.org/* /var/www/testing
rm /tmp/syncingcms
fi
And this is the crontab file
MAILTO="thecoolone19@hotmail.com"
SHELL=/bin/bash
* * * * * /var/cmsfile
On executing my script for the first time i get this:
bash -x /var/cmsfile
+ export PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/thecoolone/bin:/usr/local/bin
+ PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/thecoolone/bin:/usr/local/bin
+ '[' '!' -f /tmp/syncingcms ']'
+ touch /tmp/syncingcms
+ /usr/bin/rsync -av -e /usr/bin/ssh --exclude '*.svn*' thecoolone@vtu.org:/var/www/vtu/info.vtu.org/* /var/www/testing
thecoolone@vtu.org password: "I type in the pwd"
receiving file list ... done
rsync: recv_generator: mkdir "/var/www/testing/CVS" failed: Permission denied (1 3)
rsync: stat "/var/www/testing/CVS" failed: No such file or directory (2)
rsync: recv_generator: mkdir "/var/www/testing/maths" failed: Permission denied (13)
rsync: stat "/var/www/testing/maths" failed: No such file or directory (2)
rsync: recv_generator: mkdir "/var/www/testing/maths/images" failed: No such fi le or directory (2)
And this goes on for all the files. And after its done i checked the testing directory and nothing is backed up
And another bizzare thing is when i execute $bash -x /var/cmsfile for the 2nd time again i get this msg:
+ export PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/thecoolone/bin:/usr/local/bin
+ PATH=/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/thecoolone/bin:/usr/local/bin
+ '[' '!' -f /tmp/syncingcms ']'
Only when i remove the /tmp/syncingcms file am i able to execute the script again.
can someone tell me whats happening in here?
thanx in advance