- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: zip files need to be unzipped through cron
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 01:03 AM
тАО09-21-2005 01:03 AM
I am using a Red Hat Linux Server in which I am getting soem files from the remote locations through ftp in zipped format. Now the files which I am getiing goes in diff directories. I want to unzip these files through cron so that Manually i don't need to browse through each directory and unzip it.
The problem is when I run unzip * command it doesn't run I have to manually unzip one by one file. So I can't put it in cron.
Please help me out to solve this ..
Thanks and regards,
Abhijit
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 01:28 AM
тАО09-21-2005 01:28 AM
Re: zip files need to be unzipped through cron
I believe you are simply putting 'unzip *' in your crontab, it will not work since cron does not understand the current directory. you may have to put it like 'unzip /path/to/zip/folder/*.zip'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 01:31 AM
тАО09-21-2005 01:31 AM
Re: zip files need to be unzipped through cron
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 01:36 AM
тАО09-21-2005 01:36 AM
Re: zip files need to be unzipped through cron
Try this:
#!/bin/sh
# Search through a directory and unzip all files
DIR="dir_to_search"
find ${DIR} -name '*.zip" -exec gunzip {} \;
To extract the files use -d
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 01:48 AM
тАО09-21-2005 01:48 AM
Solution#!/usr/bin/sh
# Search through a directory and unzip all files
DIR="dir_to_search"
find ${DIR} -name '*.zip' -exec gunzip {} \;
#EOT
Save this file as /root/gunzipper.sh
Put an entry in the crontab like:
# minute hour monthday month weekday command
0 0 * * * /root/gunzipper.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 01:59 AM
тАО09-21-2005 01:59 AM
Re: zip files need to be unzipped through cron
If you want your job to be able to run unzip or zip without the full path, set the PATH variable before running any commands.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 02:25 AM
тАО09-21-2005 02:25 AM
Re: zip files need to be unzipped through cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 04:13 AM
тАО09-21-2005 04:13 AM
Re: zip files need to be unzipped through cron
Thanks for the script it worked
thank you very much
Regards,
Abhijit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-21-2005 04:26 AM
тАО09-21-2005 04:26 AM
Re: zip files need to be unzipped through cron
thanks