LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Excluding specific folders from backup (http://www.linuxquestions.org/questions/ubuntu-63/excluding-specific-folders-from-backup-465657/)

karloslambchop 07-19-2006 04:33 PM

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.

gilead 07-19-2006 05:24 PM

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 /

karloslambchop 07-19-2006 05:32 PM

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

gilead 07-19-2006 05:56 PM

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 /

karloslambchop 07-21-2006 06:34 PM

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.

gilead 07-21-2006 07:04 PM

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

karloslambchop 07-21-2006 07:47 PM

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 ...

:Pengy:

gilead 07-21-2006 08:10 PM

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 :)


All times are GMT -5. The time now is 05:28 AM.