Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Backup action's description. Separate words with underscores.
- HELPERS="$HELPERS home:backup_of_home_directories"
- home_wizard() {
- home_title="Home action wizard"
- backupname=`hostname --fqdn`
- # Specify default value for the time when this backup actions is supposed to run
- inputBox "$home_title" "When to run this action?" "everyday at 01"
- [ $? = 1 ] && return
- home_when_run="when = $REPLY"
- # Specify default value for backup file name
- inputBox "$home_title" "\"Name\" of backups" "$backupname"
- [ $? = 1 ] && return
- home_backupname="backupname = $REPLY"
- backupname="$REPLY"
- # Specify default directory to store the backups
- inputBox "$home_title" "Directory where to store the backups" "/var/backups/home"
- [ $? = 1 ] && return
- home_backupdir="backupdir = $REPLY"
- # Specify default values for the radiobox
- radioBox "$home_title" "Compression" \
- "none" "No compression" off \
- "gzip" "Compress with gzip" on \
- "bzip" "Compress with bzip" off
- [ $? = 1 ] && return;
- result="$REPLY"
- home_compress="compress = $REPLY "
- REPLY=
- while [ -z "$REPLY" ]; do
- formBegin "$home_title: Includes"
- formItem "Include:" /home/gacanepa
- formDisplay
- [ $? = 0 ] || return 1
- home_includes="includes = "
- for i in $REPLY; do
- [ -n "$i" ] && home_includes="$home_includes $i"
- done
- done
- REPLY=
- while [ -z "$REPLY" ]; do
- formBegin "$home_title: Excludes"
- formItem "Exclude:" *.mp3
- formItem "Exclude:" *.mp4
- # Add as many “Exclude” text boxes as needed to specify other exclude options
- formItem "Exclude:"
- formItem "Exclude:"
- formDisplay
- [ $? = 0 ] || return 1
- home_excludes="excludes = "
- for i in $REPLY; do
- [ -n "$i" ] && home_excludes="$home_excludes $i"
- done
- done
- # Save the config
- get_next_filename $configdirectory/10.home
- cat > $next_filename <<EOF
- $home_when_run
- $home_backupname
- $home_backupdir
- $home_compress
- $home_includes
- $home_excludes
- # tar binary - have to be GNU tar
- TAR `which tar`
- DATE `which date`
- DATEFORMAT "%Y-%m-%d"
- EXTENSION tar
- EOF
- # Backupninja requires that configuration files be chmoded to 600
- chmod 600 $next_filename
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement