| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor|
|Cron Job Assistance|
| 5:04 pm on Jan 27, 2005 (gmt 0)|
I'm having a spot of bother with the cron job shown below.
What it suppose to do is:
1. Unzip the zip files in the given directory
2. Move the zip files into a zip directory
3. Move the log file after it has been unzipped into the logs directory.
The trouble I am having is that I'm not quite how to put this all together I've had a go, I've used the pipe command but I don't think that is the right command to use.
30 09 * * * /usr/bin/unzip /home/sites/test.domain.com/ex*.zip ¦ mv /home/sites/test.domain.com/ex*.zip /home/sites/test.domain.com/zips ¦ mv /home/sites/test.domain.com/ex*.log /home/sites/test.domain.com/logs
| 5:09 pm on Jan 27, 2005 (gmt 0)|
Put the commands that you want executed into a shell script, make sure that the script is executable and then call the script from your cronjob.
mv /home/sites/test.domain.com/ex*.zip /home/sites/test.domain.com/zips
mv /home/sites/test.domain.com/ex*.log /home/sites/test.domain.com/logs
and then in your cron file
30 09 * * * script.sh
Hope this works
| 5:17 pm on Jan 27, 2005 (gmt 0)|
Much appreciated for the feedback, and so quick as well, nice! :o)
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
© Webmaster World 1996-2014 all rights reserved