- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: redirect tar?
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
04-17-2005 02:36 PM
04-17-2005 02:36 PM
When I try something like
tar cvf /tmp/mytar.tar /tmp/error >/tmp/mytar.log
I do not get the expected .log file. While /tmp/mytar.log is created it is empty and tar -v still writes to the screen?
There is a tar command running from cron that backs up files. All I want to do is redirect the output of this command so that I can check the log file in the morning.
Ian
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2005 03:10 PM
04-17-2005 03:10 PM
Re: redirect tar?
You have a script to backup the files. And this script is scheduled using cron. If you want the output of the scheduled job, then you can specify the log in the cron schedule itself.
For example you have scheduled the script called "backup_tar.sh" which has the commands to backup the files using tar, and you schedule this script to run every day at 16:00 hours then do this.
00 16 * * * /path/backup_tar.sh > /path/logs/backup_tar_output.log
This backup_tar_output.log will have the output of the backup script execution.
Indira A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2005 06:18 PM
04-17-2005 06:18 PM
Re: redirect tar?
nohup tar cvf /tmp/mytar.tar /tmp/error so that it will log all details into nohup.log file.
If you get messages on screen then it may be ERROR messages. Try as,
tar cvf /tmp/mytar.tar /tmp/error 1>/tmp/mytar.log 2>&1
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 11:27 AM
04-18-2005 11:27 AM
Re: redirect tar?
I have tried using nohup as suggested
nohup tar cvf /tmp/mytar.tar /tmp/error.
I still got the tar listing on the screen and couldn't find the nohup log in either the current directory or the $HOME directory?
When I try
tar cvf /tmp/mytar.tar /tmp/error 1>/tmp/mytar.log
I get an error message saying
tar : cannot stat 1. not dumped
Can I tell tar that 1 is not a file to be added to the archive?
This is not a major problem for me as I can write a script for the cron job as suggested by Indira.
I am still curious and frustrated as to why I can't achieve this seemly simple redirection. I have no problems achieving this in Linux but fails with HPUX.
Ian.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2005 03:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 05:45 AM
04-19-2005 05:45 AM
Re: redirect tar?
tar cvf /tmp/mytar.tar /tmp/error > /tmp/mytar.log 2>&1
will do it for you.
bueno bye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2005 05:53 AM
04-19-2005 05:53 AM
Re: redirect tar?
LOGFILE=/tmp/mytar.log
tar cvf /tmp/mytar.tar /tmp/error | tee -a $LOGFILE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2005 03:29 PM
04-20-2005 03:29 PM