Hi all. To this day I still can't get the following to work from a cron job: mt -f /dev/st0 setblk 32768 && tar -cSPf /dev/st0 -b 64 /store/bkup && mt -f /dev/st0 rewoffl It returns the following error: tar: /dev/st0: Wrote only 0 of 32768 bytes tar: Error is not recoverable: exiting now The job runs without complaining on a root konsole. If anyone can help sort this out once and for all I *really* will be chuffed. TIA Best regards, Darryl ---- Edgemead High School (Northern Suburbs, Cape Town) Powered by SuSE Linux 8.2 ----
Hi, Am Donnerstag, 27. November 2003 14:59 schrieb darryl penny:
To this day I still can't get the following to work from a cron job:
mt -f /dev/st0 setblk 32768 && tar -cSPf /dev/st0 -b 64 /store/bkup && mt -f /dev/st0 rewoffl
It returns the following error: tar: /dev/st0: Wrote only 0 of 32768 bytes tar: Error is not recoverable: exiting now
The job runs without complaining on a root konsole. If anyone can help sort this out once and for all I *really* will be chuffed.
Don't know if it is part of your problem, but with cron you should watch out for the $PATH environment within the cron job - I would either explicitly define $PATH within the cron job or use absolut paths for the binaries that the cron job is calling. Also worth checking is who is the owner of the job (it might be dropping privileges). Greetings from Bremen hartmut
On Sat, 29 Nov 2003 11:32:23 +0100, Hartmut Meyer wrote
Hi,
Am Donnerstag, 27. November 2003 14:59 schrieb darryl penny:
To this day I still can't get the following to work from a cron job:
mt -f /dev/st0 setblk 32768 && tar -cSPf /dev/st0 -b 64 /store/bkup && mt -f /dev/st0 rewoffl
It returns the following error: tar: /dev/st0: Wrote only 0 of 32768 bytes tar: Error is not recoverable: exiting now
The job runs without complaining on a root konsole. If anyone can help sort this out once and for all I *really* will be chuffed.
Don't know if it is part of your problem, but with cron you should watch out for the $PATH environment within the cron job - I would either explicitly define $PATH within the cron job or use absolut paths for the binaries that the cron job is calling. Also worth checking is who is the owner of the job (it might be dropping privileges).
Greetings from Bremen hartmut
<Start Bruce's reply>
My first suggestion would be to make a script out of the 3 commands you have there and make sure it works. Put it in /usr/local/bin for example and then put in your cron job:
/usr/local/bin/<name of script>
and see if that works. And provide actual paths to all commands because both cron and shell scripts usually require full paths. <End Bruce's reply>
Thanks to Hartmut and Bruce for your input. I will try your suggestions and let you know. Best regards, Darryl ---- Edgemead High School (Northern Suburbs, Cape Town) Powered by SuSE Linux 8.2 ----
participants (2)
-
darryl penny
-
Hartmut Meyer