Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a cron file to unzip files

Status
Not open for further replies.

SM777

Technical User
Mar 7, 2001
208
GB
I'd like to automate a manual process I am performing which unzips files on the server. If this was DOS commands, I'd do it in a whizz, I'm not too hot on Linux. Here is the sequence of events.

Monday 19:00 I ftp a zip file to server. If succesful TX I ftp a filesuploaded.flg file to the server to indicate files uploaded succesfully. PKUNZIP the files

1) 8:00pm every monday check for the existance of filesuploaded.flg. If file does not exist bomb out sending a 'filesnotuploaded' email
2) pkzip to unzip the files
3) check if one of the unzipped files exists, if yes send "success" message, if no send "pkzip failed" message.

I can work out how to submit a cron file, but how the heck do you create the 'batch' file? what name do you give it? is it possible to use condition states such as in 1) to check if file exists, wait for 1 min before timing out?

Cheers.
 
You're going to want to look into shell scripting and the command "test". File extensions mean nothing in linux, a file is executable if you set it +x.

Also, you probably want gzip, not pkzip.
 
I use PKZIP for linux as I couldnt get gzip/gunzip to unzip subdirectories.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top