cron jobs to unzip files

Satch

Verified User
Joined
Oct 8, 2004
Messages
5
Hi,

I was wondering how to use a cron job to unzip a file and then eliminate the cron job so it doesn't repeatedly unzip the file once the original job is done?

Thanks,

Satch
 
crond is normally used for a repetive process, sounds like you should be using another method to acomplish what you want, give more details maybe there is another way.
 
PHP:
if [ -e /myfile ]; then tar zxvf /myfile.tar.gz -C/outdir ; rm /myfile.tar.gz ; fi

If you're file exists it will extract it and then delete it to a give dir.


Don't know if you can implement this line directly in the crontab, else create this file in /root/fileunzip.sh or something and then add it to the cron ;)

Good luck!
 
Back
Top