Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Dec 2002 14:58:10 -0500
From:      Mike Galvez <mrg8n@virginia.edu>
To:        Eric Six <erics@sirsi.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Cron script problem....
Message-ID:  <20021211195810.GE52853@mail.virginia.edu>
In-Reply-To: <DC32C8CEB3F8D311B6B5009027DE5AD505E33F68@stlmail.dra.com>
References:  <DC32C8CEB3F8D311B6B5009027DE5AD505E33F68@stlmail.dra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 11, 2002 at 01:05:13PM -0600, Eric Six wrote:
> Hi All,
>=20
> 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. Wha=
t 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;
>=20
> ~begin~
> #!/usr/bin/perl -w
> # tar cf filename.tar pathtotar/
>=20
> chomp ($SCP=3D`which scp`);
> chomp ($SSH=3D`which ssh`);
>=20
> $pathtomakebackup=3D"/bind_backups";
> chomp ($today=3D`date`);
>=20
> my ($day,$month,$date,$time,$timezone,$year) =3D split (' ',$today);
> $archive_date=3D"$month-$date-$year";
>=20
> `$SSH backupuser\@server13.blah.com mkdir ~/bind_backups/nsX/$archive_dat=
e >
> /var/log/ssh.log 2>&1`;
^^^^^^^^^^^
Does the user have permission to write to this file?

> `$SCP -vr $pathtomakebackup/$archive_date/
> backupuser\@server13.blah.com:~/bind_backups/nsX/ > /var/log/scp.log 2>&1=
`;
> ~end~
>=20
> 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 h=
ave
> it setup in cron;
>=20
> 05 22 * * 1,3,5 perl /adminscripts/erics/bind_backup_scp.pl
>=20
>=20
> It works fine from cron on Solaris and Linux... anyone have any ideas?=20
>=20
> TIA
> Eric
>=20
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

--=20
Michael Galvez             http://www.people.virginia.edu/~mrg8n
Computer Systems Sr. Engineer         Office: 434-982-2975=20
Financial Analysis                    E-Mail: mrg8n@virginia.edu
University of Virginia        Messenger Mail: Carruthers Hall

Toilet Toup'=08ee, n.:
	Any shag carpet that causes the lid to become top-heavy, thus
creating endless annoyance to male users.
		-- Rich Hall, "Sniglets"

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?20021211195810.GE52853>