- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- crontab and gzip
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
Forums
Discussions
Discussions
Discussions
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
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
05-07-2009 02:53 AM
05-07-2009 02:53 AM
I have a script where scp file and then gzip the file which is working OK, but when run it via root crontab the gzip step not work!? any idea way?
-----------my script ---------------
cd /usr3/live/BATELCO/NRT/NRT_src
ls *NR_BHRBT_* | read LINE
if [ $? = 0 ]
[ -f "$LINE" -a -z "$(fuser $LINE 2> /dev/null)" ]
then
mv $LINE /usr3/live/BATELCO/NRT/NRT_backup
date | read sdate
echo Start copy $LINE $sdate... >>/usr3/live/BATELCO/NRT/NRT_daily_out.log
cd /usr3/live/BATELCO/NRT/NRT_backup
scp $LINE BHRBTF@bat-abc:/
if [ $? -eq 0 ];then
gzip $LINE
date | read edate
echo Finish copy $LINE $sdate >>/usr3/live/BATELCO/NRT/NRT_daily_out.log
else
cd /usr3/live/BATELCO/NRT/NRT_backup
mv $LINE /usr3/live/BATELCO/NRT/NRT_src
cd /usr3/live/BATELCO/NRT
date | read edate
echo Failed copy of $LINE "$edate" connection problem >/usr3/live/BATELCO/NRT/NRT_faild.log
cat NRT_faild.log >> NRT_daily_out.log
NRT_faild.log
fi
else
cd /usr3/live/BATELCO/NRT
date | read edate
echo Failed $LINE "$edate"... BUSY or NO file >/usr3/live/BATELCO/NRT/NRT_faild.log
fi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 02:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 03:00 AM
05-07-2009 03:00 AM
Re: crontab and gzip
Specify the full path of gzip executable instead of just specifying "gzip $LINE" when you schedule in crontab.
Cron will not inherit any environment varialbles including $PATH
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 03:00 AM
05-07-2009 03:00 AM
Re: crontab and gzip
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 03:04 AM
05-07-2009 03:04 AM
Re: crontab and gzip
Each of your command which you are using into this script needs full path then only cron can successfully executed.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 03:18 AM
05-07-2009 03:18 AM
Re: crontab and gzip
Thanks for replay....
I add full patch, but still not worked....
gzip /usr3/live/BATELCO/NRT/NRT_backup/$LINE
Rgds,
Ahmed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 03:24 AM
05-07-2009 03:24 AM
Re: crontab and gzip
/usr/contrib/bin/gzip
instead of just
gzip
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 03:35 AM
05-07-2009 03:35 AM
Re: crontab and gzip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2009 03:38 AM
05-07-2009 03:38 AM
Re: crontab and gzip
You need to click "submit points".
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
