6 su freeside -c "pg_dump $database" >/var/backups/$database.sql
10 #NOTE: These two paths must end in a / in
11 #order to correctly build up the other paths
12 #BACKUP_DIR="/backup/directory/"
14 #TEMP_BACKUP_FILES_DIR="/backup/temp/"
16 BACKUP_FILE=$BACKUP_DIR"backup-"$DATE".tar.bz2"
17 #DATABASE_FILE=$TEMP_BACKUP_FILES_DIR"foo-"$DATE".sql"
19 #These directories shouldn't end in a / although
20 #I don't think it will cause any problems if
21 #they do. There should be a space at the end though
22 #to ensure the database file gets concatenated correctly.
23 #SOURCE="/a/location /other/locations " $DATABASE_FILE
25 #echo Removing old backup directories
27 #rm -rf $TEMP_BACKUP_FILES_DIR
29 #echo Creating new backup directories
31 #mkdir $TEMP_BACKUP_FILES_DIR
33 #echo Creating database backup
34 #pg_dump -U username -f $DATABASE_FILE databaseName
36 #echo Backing up $SOURCE to file $BACKUP_FILE
37 #tar -cvpl -f $BACKUP_FILE --anchored --exclude /backup /
38 tar -cjpl -f $BACKUP_FILE --anchored --exclude /backup /
40 ##This is not necessary and possibly harmful for DVD+RW media
41 #echo Quick blanking media
42 #dvd+rw-format -blank /dev/hdc
45 growisofs -dvd-compat -Z $DEVICE -quiet -r -J $BACKUP_FILE