Skip to main content

Thread: Ubuntu Tar Backup Script, Not Excuding a Folder


i trying create tar backup script. used following article baseline:
https://help.ubuntu.com/community/backupyoursystem/tar

, ended creating:
code:
#!/bin/bash # init  date=$(date +20%y%m%d)  sudo tar -cvpzf /tmp/`hostname`_$date.tar.gz \ --exclude=/proc \ --exclude=/lost+found \ --exclude=/sys \ --exclude=/mnt \ --exclude=/media \ --exclude=/dev \ --exclude=/tmp \ --exclude=/home/jlacroix/desktop \ --exclude=/home/jlacroix/documents \ --exclude=/home/jlacroix/music \ --exclude=/home/jlacroix/pictures \ --exclude=/home/jlacroix/projects \ --exclude=/home/jlacroix/roms \ --exclude=/home/jlacroix/videos \ --exclude="/home/jlacroix/.virtualbox vms" \ --exclude=/home/jlacroix/.spideroak \ /  scp /tmp/`hostname`_$date.tar.gz jlacroix@pluto:/share/recovery/snapshots  sudo rm /tmp/`hostname`_$date.tar.gz
the problem runs, tries backup tar backup file itself. don't understand why, since backup file lives inside /tmp. 1 of directories told exclude.

second question, if exclusion of ".virtualbox vms" folder correct. folder has space in it, wrapped in double quotes. right thing do, or should put paths in double quotes make consistent?

that looks should work. similar works me. backup file picked in error or else picked should excluded?

things can think of these.
  1. if --exclude=/tmp in script includes non-printable characters (such carriage-return etc.)
  2. if /tmp symbolic link to, example, /var/tmp backup file picked under proper name.


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Ubuntu Tar Backup Script, Not Excuding a Folder


Ubuntu

Comments

Popular posts from this blog

Could not place because the source rectangle is empty

Thread: Using smartcard reader with vpnc

Adobe Font Folio 7.0 or just 7?