Date: Wed, 11 Dec 2002 13:20:09 -0600 From: "Jack L. Stone" <jackstone@sage-one.net> To: Eric Six <erics@sirsi.com>, "'freebsd-questions@FreeBSD.ORG'" <freebsd-questions@FreeBSD.ORG> Subject: Re: Cron script problem.... Message-ID: <3.0.5.32.20021211132009.01e16160@mail.sage-one.net> In-Reply-To: <DC32C8CEB3F8D311B6B5009027DE5AD505E33F68@stlmail.dra.com>
next in thread | previous in thread | raw e-mail | index | archive | help
At 01:05 PM 12.11.2002 -0600, Eric Six wrote: >Hi All, > >I am having a weird problem on a freebsd 4.7. I have two perl scripts I am >running via cron, one is run as root to make a backup of a directory and the >files in it, the second is run as a user to scp files to another box. What I >am encountering is the second script is running but dying after the first >ssh remote command. Here is what second script does; it uses ssh remote >command to create a directory on the remote server with todays date, the >next command is the actual recurise scp command. Here is what the script >looks like; > >~begin~ >#!/usr/bin/perl -w ># tar cf filename.tar pathtotar/ > >chomp ($SCP=`which scp`); >chomp ($SSH=`which ssh`); > >$pathtomakebackup="/bind_backups"; >chomp ($today=`date`); > >my ($day,$month,$date,$time,$timezone,$year) = split (' ',$today); >$archive_date="$month-$date-$year"; > >`$SSH backupuser\@server13.blah.com mkdir ~/bind_backups/nsX/$archive_date > >/var/log/ssh.log 2>&1`; >`$SCP -vr $pathtomakebackup/$archive_date/ >backupuser\@server13.blah.com:~/bind_backups/nsX/ > /var/log/scp.log 2>&1`; >~end~ > >If I run the script interactively, it works fine. From CRON it dies after >the SSH command makes the directory on the remote server. Here is how I have >it setup in cron; > >05 22 * * 1,3,5 perl /adminscripts/erics/bind_backup_scp.pl > > >It works fine from cron on Solaris and Linux... anyone have any ideas? > >TIA >Eric > Eric: I'm no script expert, but perhaps if you added the full path to perl in the cron line. That's usually a problem.... Best regards, Jack L. Stone, Administrator SageOne Net http://www.sage-one.net jackstone@sage-one.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20021211132009.01e16160>