LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-19-2006, 04:33 PM   #1
karloslambchop
LQ Newbie
 
Registered: May 2006
Location: Leeds
Distribution: Ubuntu
Posts: 29

Rep: Reputation: 15
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.
 
Old 07-19-2006, 05:24 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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 /
 
Old 07-19-2006, 05:32 PM   #3
karloslambchop
LQ Newbie
 
Registered: May 2006
Location: Leeds
Distribution: Ubuntu
Posts: 29

Original Poster
Rep: Reputation: 15
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
 
Old 07-19-2006, 05:56 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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 /
 
Old 07-21-2006, 06:34 PM   #5
karloslambchop
LQ Newbie
 
Registered: May 2006
Location: Leeds
Distribution: Ubuntu
Posts: 29

Original Poster
Rep: Reputation: 15
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.
 
Old 07-21-2006, 07:04 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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
 
Old 07-21-2006, 07:47 PM   #7
karloslambchop
LQ Newbie
 
Registered: May 2006
Location: Leeds
Distribution: Ubuntu
Posts: 29

Original Poster
Rep: Reputation: 15
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 ...

 
Old 07-21-2006, 08:10 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 05:22 PM
Best way to backup / restore mail folders i_s Linux - General 1 04-23-2005 02:05 PM
Backup fails on specific files tcamp Linux - General 3 12-19-2004 05:56 AM
Making folders on specific internal & extranl hard drives aggie65 Linux - Newbie 1 03-27-2004 01:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration