]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - updates/1.4.10/fixbackups.sh
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[people/pmueller/ipfire-2.x.git] / updates / 1.4.10 / fixbackups.sh
1 #!/bin/sh
2
3 # fix for 1.4.9 web backup
4
5 function fix_backup() {
6 /bin/gunzip -d -f $backup
7 path=${backup%/*}
8
9 # remove files wich should not have been include starting from 1.4.9
10 # --delete accept only one -T each time
11 /bin/tar --delete --file=$path/$name.tar -T /var/ipcop/backup/exclude.system
12 /bin/tar --delete --file=$path/$name.tar -T /var/ipcop/backup/exclude.user
13 # add missing hardware settings since v1.4.0
14 /bin/tar --append --file=$path/$name.tar -C / -T /var/ipcop/backup/exclude.hardware
15
16 #create backup again
17 /bin/gzip $path/$name.tar
18 # create encrypted backup again
19 /usr/bin/openssl des3 -e -salt -in $backup -out $path/$name.dat -kfile /var/ipcop/backup/backup.key
20 /bin/chown 99:99 $backup
21 /bin/chown 99:99 $path/$name.dat
22 }
23
24 name=`hostname`
25
26 backups="`/usr/bin/find /var/ipcop/backup/sets -name $name.tar.gz`"
27 if [ $backup !='' ]; then
28 for backup in $backups; do
29 fix_backup $backup
30 done
31 fi
32
33 backup="/home/httpd/html/backup/$name.tar.gz"
34 if [ -s $backup ]; then
35 fix_backup $backup
36 fi