| Ubuntu This forum is for the discussion of Ubuntu Linux. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-19-2006, 04:33 PM
|
#1
|
|
LQ Newbie
Registered: May 2006
Location: Leeds
Distribution: Ubuntu
Posts: 29
Rep:
|
Excluding specific folders from backup
Hi all karloslambchop here,
Quick question> I want to take a full backup of my system to tape, I am using command:
tar cvf /dev/st0 /
Does anyone know how I can exclude specific folders say /var/lib/vmware
I have seen the -X option in the man page but this is for files?
Any help would be very appreciated.
Take it easy,
karlos.
|
|
|
|
07-19-2006, 05:24 PM
|
#2
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,082
Rep: 
|
You can modify the following, it should back up everything (excluding /var/lib/vmware):
Code:
/bin/tar -c --exclude /var/lib/vmware -f `/bin/hostname`-`date '+%F'`.tar /
|
|
|
|
07-19-2006, 05:32 PM
|
#3
|
|
LQ Newbie
Registered: May 2006
Location: Leeds
Distribution: Ubuntu
Posts: 29
Original Poster
Rep:
|
Re: excluding folders
Hi gilead,
thanks for the speedy reply, forgive me for being thick how should the sytax look if I am sending the backup to /dev/st0?
respect
karloslambchop
|
|
|
|
07-19-2006, 05:56 PM
|
#4
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,082
Rep: 
|
As thick as I am since I didn't know off-hand and the man page didn't seem to have anything
The info page for gives an example of:
Code:
tar --create --verbose --blocking-factor=20 --file=/dev/rmt0
So I'd guess that the following "should"  work:
Code:
/bin/tar -c --exclude /var/lib/vmware --file=/dev/st0 /
|
|
|
|
07-21-2006, 06:34 PM
|
#5
|
|
LQ Newbie
Registered: May 2006
Location: Leeds
Distribution: Ubuntu
Posts: 29
Original Poster
Rep:
|
Hi gilead and everyone else
Hello, karloslambchop here again...
okay this should be simple but I am really not getting it -
Firstly, thank you gilead for taking time to post.
I want to backup to /dev/st0 everything within /root, but NOT /donotbackup
Sounds simple ehh? I am aware of the -X [file] option within the tar man page however I assume I would have to keep updating the file before every backup cycle.
My test structure is -
-/root
-/donotbakup
-/Karls-help-world
Ideally I would like to say, "send everything in /root to /dev/st0 but not the directory, /donotbackup"
I have been using this command and reckon I am close:
tar -cvf --exclude /root/donotbackup/ --file=/dev/st0 /root/
Output:
/bin/tar: Removing leading `/' from member names
/root/donotbackup/
/bin/tar: --file=/dev/st0: Cannot stat: No such file or directory
/root/
/root/.profile
/root/.bashrc
/root/dbootstrap_settings
/root/.aptitude/
/root/.aptitude/config
/root/.viminfo
/root/.xsession
/root/.bash_history
/root/.xsession-errors
/root/.fluxbox/
/root/.fluxbox/keys
/root/.fluxbox/menu
/root/.fluxbox/init
/root/.fluxbox/slitlist
/root/.fluxbox/startup
/root/.rnd
/root/.Xauthority
/root/.wm_style
/root/.vmware/
/root/.vnc/
/root/.vnc/sesman_passwd
/root/.synaptic/
/root/.synaptic/lock
/root/.synaptic/synaptic.conf
/root/.synaptic/log/
/root/.synaptic/log/2006-07-13.205433.log
/root/.synaptic/log/2006-07-19.003830.log
/root/.synaptic/log/2006-07-20.223216.log
/root/.synaptic/options
/root/.gnome2/
/root/.gnome2/accels/
/root/.gnome2_private/
/root/.gconf/
/root/.gconfd/
/root/.gconfd/saved_state
/root/.azureus/
/root/.azureus/plugins/
/root/.azureus/plugins/azplugins
/root/.azureus/plugins/bdcc
/root/.azureus/.lock
/root/.azureus/logs/
/root/.azureus/logs/debug_1.log
/root/.azureus/logs/save/
/root/.azureus/logs/save/1153159702622_debug_1.log
/root/.azureus/azureus.config
/root/.azureus/tmp/
/root/.azureus/azureus.config.bak
/root/Karls-help-world/
/root/Karls-help-world/Commands overview.rtf
/root/Karls-help-world/cool-commands
/root/Karls-help-world/commands-overview.rtf
/root/Karls-help-world/vmware-commands.rtf
/root/Karls-help-world/samba-commands.rtf
/root/Karls-help-world/accounts-and-perms.rtf
/root/Karls-help-world/display-xserver.rtf
/root/Karls-help-world/tape-commands
/root/Karls-help-world/vmadminbash
/root/donotbackup/
/root/.wine/
/root/.wine/dosdevices/
/root/.wine/dosdevices/c:
/root/.wine/dosdevices/z:
/root/.wine/drive_c/
/root/.wine/drive_c/windows/
/root/.wine/drive_c/windows/command/
/root/.wine/drive_c/windows/command/start.exe
/root/.wine/drive_c/windows/fonts/
/root/.wine/drive_c/windows/inf/
/root/.wine/drive_c/windows/inf/wine.inf
/root/.wine/drive_c/windows/system/
/root/.wine/drive_c/windows/system32/
/root/.wine/drive_c/windows/system32/drivers/
/root/.wine/drive_c/windows/system32/wcmd.exe
/root/.wine/drive_c/windows/system32/control.exe
/root/.wine/drive_c/windows/system32/help.exe
/root/.wine/drive_c/windows/system32/msiexec.exe
/root/.wine/drive_c/windows/system32/notepad.exe
/root/.wine/drive_c/windows/system32/progman.exe
/root/.wine/drive_c/windows/system32/regsvr32.exe
/root/.wine/drive_c/windows/system32/winmine.exe
/root/.wine/drive_c/windows/system32/winver.exe
/root/.wine/drive_c/windows/temp/
/root/.wine/drive_c/windows/notepad.exe
/root/.wine/drive_c/windows/regedit.exe
/root/.wine/drive_c/windows/rundll32.exe
/root/.wine/drive_c/windows/uninstall.exe
/root/.wine/drive_c/windows/winhelp.exe
/root/.wine/drive_c/windows/winhlp32.exe
/root/.wine/drive_c/windows/winebrowser.exe
/root/.wine/drive_c/windows/win.ini
/root/.wine/drive_c/windows/system.ini
/root/.wine/drive_c/windows/profiles/
/root/.wine/drive_c/windows/profiles/root/
/root/.wine/drive_c/windows/profiles/root/Desktop/
/root/.wine/drive_c/windows/profiles/root/Local Settings/
/root/.wine/drive_c/windows/profiles/root/Local Settings/Temporary Internet Files/
/root/.wine/drive_c/windows/profiles/root/Local Settings/History/
/root/.wine/drive_c/windows/profiles/root/Local Settings/Application Data/
/root/.wine/drive_c/windows/profiles/root/Cookies/
/root/.wine/drive_c/windows/profiles/root/My Documents
/root/.wine/drive_c/windows/profiles/root/My Pictures
/root/.wine/drive_c/windows/profiles/root/My Video
/root/.wine/drive_c/windows/profiles/root/My Music
/root/.wine/drive_c/windows/profiles/root/Start Menu/
/root/.wine/drive_c/windows/profiles/root/Start Menu/Programs/
/root/.wine/drive_c/windows/profiles/root/Start Menu/Programs/StartUp/
/root/.wine/drive_c/windows/profiles/root/Favorites/
/root/.wine/drive_c/windows/profiles/root/Application Data/
/root/.wine/drive_c/windows/profiles/root/Recent/
/root/.wine/drive_c/windows/profiles/root/SendTo/
/root/.wine/drive_c/windows/profiles/root/NetHood/
/root/.wine/drive_c/windows/profiles/root/Templates/
/root/.wine/drive_c/windows/profiles/root/PrintHood/
/root/.wine/drive_c/windows/profiles/All Users/
/root/.wine/drive_c/windows/profiles/All Users/Start Menu/
/root/.wine/drive_c/windows/profiles/All Users/Start Menu/Programs/
/root/.wine/drive_c/windows/profiles/All Users/Start Menu/Programs/StartUp/
/root/.wine/drive_c/windows/profiles/All Users/Desktop/
/root/.wine/drive_c/windows/profiles/All Users/Favorites/
/root/.wine/drive_c/windows/profiles/All Users/Application Data/
/root/.wine/drive_c/windows/profiles/All Users/Templates/
/root/.wine/drive_c/windows/profiles/All Users/Documents/
/root/.wine/drive_c/Program Files/
/root/.wine/drive_c/Program Files/Common Files/
/root/.wine/system.reg
/root/.wine/userdef.reg
/root/.wine/user.reg
/root/v
/root/exempt
/root/--exclude=
/root/.fonts.cache-1
/root/--exclude
/bin/tar: Error exit delayed from previous errors
Goes without saying, I am an ex-Windoze user that is learning fast on ubuntu. I do try and find answers before posting.
I Really appreciate any help on this,
respect
Karlos.
|
|
|
|
07-21-2006, 07:04 PM
|
#6
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,082
Rep: 
|
Hi Karlos, yep, it's always "fun" trying to get the right switches for commands
Looking at the output you've posted, I'd say the problem is with using the 'f' option as well as the --file option. Can you try it with the following syntax?
Code:
tar -cv --exclude /root/donotbackup --file=/dev/st0 /root
|
|
|
|
07-21-2006, 07:47 PM
|
#7
|
|
LQ Newbie
Registered: May 2006
Location: Leeds
Distribution: Ubuntu
Posts: 29
Original Poster
Rep:
|
Sincere thanks
Hi Gilead,
Outstanding! Its sad (no offence to all seasoned linux guru's) but linux always gives such a big buzz when you get something working after days weeks of searching?
Anyway, sincere thanks for the command syntax, it worked a treat.
Take it easy,
karloslambchop.
PS I think my girlfriend is slowly becoming a linux widow!!! hehe its 01:44 am ...

|
|
|
|
07-21-2006, 08:10 PM
|
#8
|
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 13.37
Posts: 4,082
Rep: 
|
Quote:
|
Originally Posted by karloslambchop
Outstanding! Its sad (no offence to all seasoned linux guru's) but linux always gives such a big buzz when you get something working after days weeks of searching?
|
Yep! The thrill of discovery is half the fun!  Of course, the more you discover, the more complicated stuff you can do and that means more searching - and more of a buzz
Quote:
|
Originally Posted by karloslambchop
PS I think my girlfriend is slowly becoming a linux widow!!! hehe its 01:44 am ...
|
I hope she's a patient woman 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:53 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|