From owner-freebsd-questions Wed Dec 11 11: 6: 0 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22B4437B401 for ; Wed, 11 Dec 2002 11:05:59 -0800 (PST) Received: from aberlour1.sirsi.com (aberlour.sirsi.com [150.147.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5333943EA9 for ; Wed, 11 Dec 2002 11:05:58 -0800 (PST) (envelope-from erics@sirsi.com) Received: from stlmail.dra.com (stlmail.dra.com [192.65.218.119]) by aberlour1.sirsi.com (8.12.1/8.12.1) with ESMTP id gBBImXaP001232 for ; Wed, 11 Dec 2002 12:48:33 -0600 (CST) Received: by stlmail.dra.com with Internet Mail Service (5.5.2656.59) id ; Wed, 11 Dec 2002 13:05:15 -0600 Message-ID: From: Eric Six To: "'freebsd-questions@FreeBSD.ORG'" Subject: Cron script problem.... Date: Wed, 11 Dec 2002 13:05:13 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message