#!/bin/sh # shell script to back up key CatDV preferences files # -- Set the window title -- # title='shell script to back up key CatDV preferences files' # echo "\033]0;$title\007" # set the path to your mysql installation MYSQLpath=/usr/local/mysql/bin echo mysql install directory echo $MYSQLpath # -- Set the paths and folder names -- # to modify the location of your backup folder change the path by replacing # the string /$HOME/Desktop with the preferred path # (this will be automatically substituted throughout the rest of the script) #Default Bpath=/$HOME/Desktop Bpath=$HOME/Desktop echo Backup path echo $Bpath # to change the name of the backup folder Type the name below in place of 'Catdv_Backups' # (no more than 30 characters alphanumeric with no white space) # (this will be automatically substituted throughout the rest of the script) #Default Bfolder='CatDV_Backups' Bfolder='CatDV_Backups' echo Backup Folder echo $Bfolder # echo the output folder echo full backup path echo $Bpath/$Bfolder # Create Directories at backup target # Change folder to Backup path cd $Bpath # Make a folder named by the variable $Bfolder mkdir $Bfolder # Change folder to $Bfolder and then make sub folders cd $Bfolder mkdir serverprefs mkdir clientprefs mkdir workerprefs mkdir Database # -- Copy the files and date + timestamp the backups -- cp /usr/local/catdvServer/catdv.properties $Bpath/$Bfolder/serverprefs/catdv-`date +%Y-%m-%d-%H.%M`.properties cp $HOME/Library/Application\ Support/worker.xml $Bpath/$Bfolder/workerprefs/worker-`date +%Y-%m-%d-%H.%M`.xml cp /Users/$(users)/Library/Application\ Support/workset.xml $Bpath/$Bfolder/workerprefs/workset-`date +%Y-%m-%d-%H.%M`.xml cp /Users/$(users)/Library/Preferences/CatDV\ Preferences $Bpath/$Bfolder/clientprefs/CatDV-`date +%Y-%m-%d-%H.%M`\ .Preferences # Backup the mysql database and date + timestamp the backups -- $MYSQLpath/mysqldump -u catdvadmin -pcatdv catdv > $Bpath/$Bfolder/Database/backup-`date +%Y-%m-%d`.sql