- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script issue!!
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
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
тАО03-07-2009 07:00 AM
тАО03-07-2009 07:00 AM
Server--RX 3600
OS -HPUX 11.23
Iam facing issue while executing the script through cron.But If iam manually executing the script its working fine...
Script setails:--it will zip some trace files in source and will move these zip files to destination.
If iam executing this script through cron its giving error "unable to zip, GZIP not found"
but if iam manually do the zip in souce then iam try to run the script using cron its working fine.
Crontab entry.
30 18 * * * /pcard17/trace/movetrace
can anybody help me in this case.
Please find the attached script...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2009 07:38 AM
тАО03-07-2009 07:38 AM
Solution> its giving error "unable to zip, GZIP not found"
Yes, I would expect that. Cron only provides a minimal environment. In the case of the PATH,, it consists only of:
PATH=/usr/bin:/usr/sbin:.
You need to use absolute paths for any commands not in the above or define you PATH list in your script. Any other environmental varaibles that you have defined in your login profile need to be defined too. The '.profile' sourced during normal logins is not handled for cron tasks.
See the 'crontab' manpages for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2009 08:54 AM
тАО03-07-2009 08:54 AM
Re: Script issue!!
I have given the absolute path for gzip command its belogs to /usr/contrib/bin but same result.
can u plesae tell me exactly what change wants to make in that script.
thnaks in advance..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-07-2009 09:53 AM
тАО03-07-2009 09:53 AM
Re: Script issue!!
Can you try calling script by creating file,
Example:-
vi movetrace.sh
/usr/contrib/bin/gzip
mv /myhome/
/usr/contrib/bin/gunzip /myhome/
# Crontab -e
30 18 * * * /pcard17/trace/movetrace.sh
Thanks,
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-08-2009 10:32 AM
тАО03-08-2009 10:32 AM
Re: Script issue!!
That should fix it.
If you have other errors, add "set -x" to the script so you can see where it fails.
You may also change your find -exec to use "+" for performance:
-exec ls -ltr {} +
As a stylistic point, instead of passing info to your move function through the variable "a", you may want to pass it explicitly as a parm:
move $a
And inside of move, use "file=$1" and then use $file throughout.
Also, why use test instead of the shell builtin "[ ... ]"?
(And indentation helps. ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-26-2009 12:04 AM
тАО10-26-2009 12:04 AM