System Backup - Exclude question

Miky

Verified User
Joined
Jun 22, 2004
Messages
31
Location
Australia
Hi,

I browsed those forums for a while and noone seems to have asked this before ...

The system backup is great on a 2 HD system, or 1HD properly partitioned , but what happens if you just want to save the tar files in say /home/backup because it's the only place where you can temporarely dump the files for later ftp/scp ...

Is there a way to Exclude directories ? .. I'd want to backup all of /home , but exclude /home/backup so it dosent backup itself :).


Cheers

Miky
 
All good , I got a shocking headache but I finally worked it out , YAY !

Thank you

Miky
 
Hi,

I havent checked the forums for a while and just noticed that I wasnt the only one after all to try exclude files or directories from Sysbk.

I also saw the following feature in the comming DA 1.232

"Change sysbk to create a backup file for each user intead of creating one large home.tar.gz file. This will also prevent /home/backup from being included in the backups..."

This is great , I like the idea of individual smaller files and it fixes my initial problem. What it does not fix is the fact that I still need to exclude a huge 3gig directory /home/admin/stuff which I dont want backed up.

I'm sure other people will come accross this issue so i'll explain how I got around it a while back.. who knows, it migh also give an idea to the DA team.

Warning !! ... if you make this little change, i'm pretty sure it will be wiped when upgrading to 1.232 and would have to be done again .. assuming it can still be done :)


1) make an exclude file with the directories/files you want to exclude. Path without leading slash as it is relative to where sysbk is when taring each "custom" directory. In my case :

# pico /usr/local/sysbk/mod/exclude

home/backup/*
home/admin/stuff/*

(Note, in my case, "home/admin/stuff/*" I guess will have to me replaced by "admin/stuff/*" after upgrading to 1.232)

2) modify Sysbk config file so the tar command reads the exclude file :
# pico /usr/local/sysbk/conf.sysbk

Find the ARC_PRI= section, not far from the top and make it look like :

if [ "$OS" = "FreeBSD" ]; then
ARC_PRI="/usr/bin/tar -X $MODPATH/exclude -cpzf"
else
ARC_PRI="/bin/tar -X $MODPATH/exclude -cpzf"
fi


3) Modify the conf.sysbk template file otherwise the above (2) will be wiped when you save modifications in the System Backup section of DA.

#pico /usr/local/directadmin/data/templates/conf.sysbk

same as (2) , find section and make it look like :

if [ "$OS" = "FreeBSD" ]; then
ARC_PRI="/usr/bin/tar -X $MODPATH/exclude -cpzf"
else
ARC_PRI="/bin/tar -X $MODPATH/exclude -cpzf"
fi


That's it, it's been working fine for me.

Miky
 
Since sysbk isn't a DirectAdmin specific program, it doesn't care what it's running on; just make sure you're backing up everything you want to backup, and of course you need to understand that sysbk doesn't have a restore function; you're on your own when restoring from sysbk.

Jeff
 
Back
Top