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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command output redirection

Status
Not open for further replies.

TonyGroves

Programmer
Joined
Aug 13, 2003
Messages
2,389
Location
IE
This is probably a very simple thing, but I'm new to Linux, and my shell-scripting skills are quite basic, so a little help would be appreciated.

I need a little script to completely back-up my Linux laptop to my W*****s server, so I wrote the following:
[tt]
#! /bin/sh
d=`date +'%Y%m%d-%H%M%S'`
sudo tar \
--exclude=/SAMBA \
--exclude=/var/spool \
-cvzf /SAMBA/tg/SERVER/backup/tonyslaptop/$d.tar.gz \
/bin /boot /etc /home /lib /opt /root /sbin /srv /usr /var \
1>~/backup.log \
2>~/backup.err
[/tt]
It seems to work fine, except that the 'verbose' output of directories being backed-up appears on the screen, not in the log file as intended. Can somebody tell me what I need to do?

Thanks a lot.
 
Strange - it seems to be working now!

Thanks.
 
Thanks, I'll fix that.

It works OK though. The log file just gets skipped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top