Script doesn't complete via Cron
Script - #!/bin/sh # # To roll up a zip file of source code # date=`date '+%Y-%m-%d'` cd ~/temp rm -rf foo_dev foo.zip export CVS_RSH=ssh export CVSROOT=:ext:[EMAIL PROTECTED]:/xxx/yyy/zzz cvs -Q export -D $date -d foo_dev foo zip -q -r foo foo_dev scp -q foo.zip server_name: rm -rf foo_dev foo.zip -- Cron job - -- # export, zip up and scp foo source to server_name 17 14 * * * /home/bar/bin/export-foo 2 /dev/null /dev/null -- When I execute the script by hand, it completes without any problems. When I let a cronjob handle it, it doesn't scp the zip file to the remote server. I don't get any errors in /var/log/auth.log or /var/log/messages Anyone has any ideas on how to fix this up? Thanks ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Script doesn't complete via Cron
- Original Message - From: Gerard Samuel [EMAIL PROTECTED] To: FreeBSD Questions [EMAIL PROTECTED] Sent: Friday, September 12, 2003 1:26 PM Subject: Script doesn't complete via Cron When I execute the script by hand, it completes without any problems. When I let a cronjob handle it, it doesn't scp the zip file to the remote server. I don't get any errors in /var/log/auth.log or /var/log/messages Anyone has any ideas on how to fix this up? Thanks Try having the script call scp by the /path/to/the/scp/executable. HTH, Kevin Kinsey ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Script doesn't complete via Cron
At 14:26 12.09.2003 -0400, Gerard Samuel wrote: ... scp -q foo.zip server_name: rm -rf foo_dev foo.zip -- Cron job - -- # export, zip up and scp foo source to server_name 17 14 * * * /home/bar/bin/export-foo 2 /dev/null /dev/null -- When I execute the script by hand, it completes without any problems. When I let a cronjob handle it, it doesn't scp the zip file to the remote server. I don't get any errors in /var/log/auth.log or /var/log/messages Anyone has any ideas on how to fix this up? We had a similar problem with scp if I remember right. The problem was the remote server where a message was echoed during login with ssh (some echo stuff in the .profile or something like this). It seemed to be that scp got this echo-message too and then failed to operate. After removing the echo commands everything worked fine. Note: I may be wrong, its long time ago. Alexander -- -- Alexander Haderer Charite Campus Virchow-Klinikum Tel. +49 30 - 450 557 182Strahlenklinik und Poliklinik Fax. +49 30 - 450 557 117Sekr. Prof. Felix Email [EMAIL PROTECTED]Augustenburger Platz 1 www http://www.charite.de/rv/str/ 13353 Berlin - Germany -- ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
RE: Script doesn't complete via Cron
I'm extremely new to scripted scp, so this may be idiotic: Assuming you are using rsa or dsa public key authentication for the transfer, you need to make sure the crontab was setup from the account of the authenticated user. Setting it up under root's crontab won't work - the script will request a password to initiate the transfer and never receive a response. For example, I have an user account called copy created for scp transfers. This user has an rsa key assigned and copied to each target server. I then set up a job using crontab -e from copy's account to initiate the transfer. If I try the same job using root's crontab, it fails (timeout waiting for a password response). Hopefully that drivel made some sense. Jim -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Gerard Samuel Sent: Friday, September 12, 2003 1:26 PM To: FreeBSD Questions Subject: Script doesn't complete via Cron Script - #!/bin/sh # # To roll up a zip file of source code # date=`date '+%Y-%m-%d'` cd ~/temp rm -rf foo_dev foo.zip export CVS_RSH=ssh export CVSROOT=:ext:[EMAIL PROTECTED]:/xxx/yyy/zzz cvs -Q export -D $date -d foo_dev foo zip -q -r foo foo_dev scp -q foo.zip server_name: rm -rf foo_dev foo.zip -- Cron job - -- # export, zip up and scp foo source to server_name 17 14 * * * /home/bar/bin/export-foo 2 /dev/null /dev/null -- When I execute the script by hand, it completes without any problems. When I let a cronjob handle it, it doesn't scp the zip file to the remote server. I don't get any errors in /var/log/auth.log or /var/log/messages Anyone has any ideas on how to fix this up? Thanks ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ This message was scanned and certified Virus Free by Alexssa | HNet. www.alexssa.net www.hnet.net ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Script doesn't complete via Cron
Ok, I figured out the problem. The step that creates the zip file, wasn't creating the zip file, because, I wasn't using the full path to the zip command. Since there was no files to scp, the script ended. Once I started using /usr/local/bin/zip, things started working correctly with cron. Gerard Samuel wrote: Script - #!/bin/sh # # To roll up a zip file of source code # date=`date '+%Y-%m-%d'` cd ~/temp rm -rf foo_dev foo.zip export CVS_RSH=ssh export CVSROOT=:ext:[EMAIL PROTECTED]:/xxx/yyy/zzz cvs -Q export -D $date -d foo_dev foo zip -q -r foo foo_dev scp -q foo.zip server_name: rm -rf foo_dev foo.zip -- Cron job - -- # export, zip up and scp foo source to server_name 17 14 * * * /home/bar/bin/export-foo 2 /dev/null /dev/null -- When I execute the script by hand, it completes without any problems. When I let a cronjob handle it, it doesn't scp the zip file to the remote server. I don't get any errors in /var/log/auth.log or /var/log/messages Anyone has any ideas on how to fix this up? Thanks ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]