2006-04-12 23:17:06 +02:00
|
|
|
# -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
|
2009-05-22 15:27:09 +02:00
|
|
|
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
|
2006-04-12 23:17:06 +02:00
|
|
|
|
|
|
|
HELPERS="$HELPERS tar:tar_backup"
|
|
|
|
|
|
|
|
tar_wizard() {
|
|
|
|
tar_title="Tar action wizard"
|
|
|
|
|
|
|
|
backupname=`hostname --fqdn`
|
|
|
|
|
|
|
|
inputBox "$tar_title" "When to run this action?" "everyday at 01"
|
|
|
|
[ $? = 1 ] && return
|
|
|
|
tar_when_run="when = $REPLY"
|
|
|
|
|
|
|
|
inputBox "$tar_title" "\"Name\" of backups" "$backupname"
|
|
|
|
[ $? = 1 ] && return
|
|
|
|
tar_backupname="backupname = $REPLY"
|
2009-05-22 14:50:52 +02:00
|
|
|
backupname="$REPLY"
|
2006-04-12 23:17:06 +02:00
|
|
|
|
2011-04-26 11:05:49 +02:00
|
|
|
inputBox "$tar_title" "Directory where to store the backups" "/var/backups/tar/$backupname"
|
2006-04-12 23:17:06 +02:00
|
|
|
[ $? = 1 ] && return
|
|
|
|
tar_backupdir="backupdir = $REPLY"
|
|
|
|
|
|
|
|
radioBox "$tar_title" "Compression" \
|
|
|
|
"none" "do not filter trough" off \
|
|
|
|
"compress" "filter trough compress" off \
|
|
|
|
"gzip" "filter trough gzip" off \
|
2013-06-27 21:36:23 +02:00
|
|
|
"bzip" "filter trough bzip" on \
|
|
|
|
"xz" "filter trough xz" off
|
2009-05-22 14:50:52 +02:00
|
|
|
[ $? = 1 ] && return;
|
2006-04-12 23:17:06 +02:00
|
|
|
result="$REPLY"
|
|
|
|
tar_compress="compress = $REPLY "
|
|
|
|
|
|
|
|
REPLY=
|
|
|
|
while [ -z "$REPLY" ]; do
|
|
|
|
formBegin "$tar_title: Includes"
|
|
|
|
formItem "Include:" /etc
|
|
|
|
formItem "Include:" /home
|
|
|
|
formItem "Include:" /usr/local
|
|
|
|
formItem "Include:"
|
|
|
|
formItem "Include:"
|
|
|
|
formItem "Include:"
|
|
|
|
formItem "Include:"
|
|
|
|
formItem "Include:"
|
|
|
|
formItem "Include:"
|
|
|
|
formItem "Include:"
|
|
|
|
formItem "Include:"
|
|
|
|
formDisplay
|
|
|
|
[ $? = 0 ] || return 1
|
|
|
|
tar_includes="includes = "
|
|
|
|
for i in $REPLY; do
|
2009-05-22 14:50:52 +02:00
|
|
|
[ -n "$i" ] && tar_includes="$tar_includes $i"
|
2006-04-12 23:17:06 +02:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
REPLY=
|
|
|
|
while [ -z "$REPLY" ]; do
|
|
|
|
formBegin "$tar_title: Excludes"
|
2009-05-22 14:50:52 +02:00
|
|
|
formItem "Exclude:" /tmp
|
2006-04-12 23:17:06 +02:00
|
|
|
formItem "Exclude:" /proc
|
|
|
|
formItem "Exclude:" /sys
|
|
|
|
formItem "Exclude:" /dev
|
|
|
|
formItem "Exclude:" /srv
|
|
|
|
formItem "Exclude:" /media
|
|
|
|
formItem "Exclude:" /misc
|
|
|
|
formItem "Exclude:" /net
|
|
|
|
formItem "Exclude:" /selinux
|
2009-05-22 14:50:52 +02:00
|
|
|
formItem "Exclude:"
|
2006-04-12 23:17:06 +02:00
|
|
|
formItem "Exclude:"
|
|
|
|
formDisplay
|
|
|
|
[ $? = 0 ] || return 1
|
|
|
|
tar_excludes="excludes = "
|
|
|
|
for i in $REPLY; do
|
2009-05-22 14:50:52 +02:00
|
|
|
[ -n "$i" ] && tar_excludes="$tar_excludes $i"
|
2006-04-12 23:17:06 +02:00
|
|
|
done
|
|
|
|
done
|
|
|
|
|
2009-05-22 14:50:52 +02:00
|
|
|
# Save the config
|
2006-04-12 23:17:06 +02:00
|
|
|
get_next_filename $configdirectory/10.tar
|
|
|
|
cat > $next_filename <<EOF
|
|
|
|
$tar_when_run
|
|
|
|
$tar_backupname
|
|
|
|
$tar_backupdir
|
|
|
|
$tar_compress
|
|
|
|
$tar_includes
|
|
|
|
$tar_excludes
|
|
|
|
|
|
|
|
# tar binary - have to be GNU tar
|
|
|
|
#TAR=/bin/tar
|
2009-05-22 14:50:52 +02:00
|
|
|
#DATE /bin/date
|
|
|
|
#DATEFORMAT "%Y.%m.%d-%H%M"
|
2006-04-12 23:17:06 +02:00
|
|
|
|
|
|
|
EOF
|
|
|
|
chmod 600 $next_filename
|
|
|
|
}
|
|
|
|
|