On Mon, 12 Mar 2007 19:37:26 +1300 Roger Searle <[EMAIL PROTECTED]> wrote:
> I'd be interested in seeing your script. What I was posting last week > was just a sample of what I am doing for a home solution but I know I > need further modifications. For example excluding certain (and > multiple) folders and wildcard options for example copying multiple > user's firefox bookmark files from a windows "docs and settings" > folder. Then copying to a different drive, and different machine. > Burning to dvd would be good too, I'm sure that is likely to be an extra > line or 2 in the script. > > Your script may well give me some more ideas I haven't thought of. > > Cheers, > Roger > > > Steve Holdoway wrote: > > I'm happy to post my generic backup script that you can run from cron and > > forget. If not too much personal data, then ftp'ing to your server / > > emailing to a gmail account ( nail is a good simple command line tool to > > send a tgz as an attachment ) are both good options for offsite backup. > > > > Steve > > > > On Mon, 12 Mar 2007 11:48:04 +1300 > > Eliot Blennerhassett <[EMAIL PROTECTED]> wrote: > > > > > >> Stephen Irons wrote: > >> > >>> * no desktop distro comes with a backup system for grandma > >>> > >> Can anybody contradict this statement? > >> (I tend to agree it is true, including the other home user OSes) > >> > >> Given the prevailing wisdom (on this list anyway) that harddrives WILL > >> fail, surely backup is just as important as firewall, antivirus etc for > >> overall system security. "You DID back up you files didn't you??" > >> > >> Working system = > >> Working [apps email internet printing display wireless BACKUP]? > >> > >> Should desktop distros install *something* by default that increases > >> data security? > >> > >> Do you know of either > >> * an existing backup system that will work for Grandma? > >> or > >> * a wizard (i.e. documented deterministic process) to set up one of the > >> existing backup solutions for gurus so it works for Grandma? > >> > >> Hmmm. What can I install on this ubuntu box? > >> amanda, backuppc, bacula, chiark-backup, flexbackup, hdup, hubackup, > >> kdar, keep, konserve, mondo, rdiff-backup, sbackup, simplebackup, slbackup, > >> > >> AFAIK, none of these is installed by default. Which, if any, could > >> grandma cope with? > >> > >> Anyone have any comments on any of the above systems. > >> (I'll reply to myself about Bacula which I am using atm) > >> =============================================================== > >> My off the cuff thoughts about what grandmas-backup should do: > >> > >> * run automatically > >> > >> * install with defaults that do something to back up data, even if it is > >> not ideal > >> > >> * suggest/use available backup devices E.g. Partition on hard drive, 2nd > >> hard drive, CD or DVD writer, other networked PC, internet storage of > >> some kind etc. > >> > >> * Prompt periodically for better backup (eg if backup is only happening > >> to local HDD - "Time to call your grandson to back up your photos...") > >> > >> * Back up the at least home directory, system configuration, (? > >> understand what is easily restored from installation media or network) > >> > >> * Your sage advice here -> > >> ================================================================ > >> > >> regards > >> > >> Eliot > >> ===== > >> See the 1st and 7th items: > >> http://www.strangeplaces.net/weirdthings/haiku.html > >> > >> > >> > > > > Well, you can see it's got commented out code for plenty of different methods. Currently, it nfs mounts and saves the archives to a remote machine. It has also, at one time, used scp to save them instead. Code is there to perform backups of mysql and postgres databases, as well as making straight tar archives ( I then gzip them - this takes longer but lowers the load on the server ). It's not pretty, but it's flexible, and is running in one shape or form on about a dozen of my servers, mainly running linux, but also solaris and a couple of *bsd's. You just need to validate the programs at the top are pointing to the correct place, and configure what you want to secure. ymmv... Steve. --8<-- #!/bin/sh # # Author: Steve Holdoway # Version: 1.0 # Date: 20th Dec 2004 # Purpose: To back up volatile files to the backup server over the # gigabit san. # # Gotchas: As this is run from cron, and I use gnu tar, there are # issues with finding the correct zip program due to the # lack of PATH setup. I could have just built up the # required PATH, but instead I have used absolute paths... # however, this has meant that the compression program needs # to be explicitly set, rather than just using the --gzip flag # # Conversion from Slowlaris -> Linux. Native tar ok. # Setup Programs # We're using a copy of gnu tar, 'cos solaris tar is crap #Tar="/bin/tar --create --verbose --ignore-failed-read --gzip" Tar="/bin/tar --create --verbose --ignore-failed-read" Scp="/usr/bin/scp -P 2222 -q" Rm="/bin/rm" Find="/usr/bin/find" Gzip="/bin/gzip" MySQLDump="/usr/local/mysql/bin/mysqldump --all-databases --add-drop-table --flush-logs --extended-insert --create-options --disable-keys --single-transaction --quick" PGDumpAll="/usr/local/pgsql/bin/pg_dumpall" Mount="/bin/mount" Umount="/bin/umount" MkDir="/bin/mkdir" # Setup Environment DateStamp=`/bin/date +%y-%m-%d` HostName="server" BackupHost="[EMAIL PROTECTED]" #Archive="Archive.tar.gz" Archive="Archive.tar" List="FileList.txt" MysqlDB="mysql.sql" PostgresqlDB="postgresql.sql.gz" # Setup Backup specific stuff Dirs="/bin /boot /etc /home /initrd /lib /misc /opt /root /sbin /selinux /srv /sys /usr /var /www" ExcludeDirs="--exclude=/home/mysql --exclude=/var/lib/mysql4" ArchiveDir="/backup/${HostName}" # NFS mount the correct directory... $Mount -t nfs a.b.c:/backup /backup # Move if [ ! -d $ArchiveDir ] then $MkDir -p $ArchiveDir fi cd $ArchiveDir # Force cleanup $Rm -f $Archive ${Archive}.gz $List ${MysqlDB} ${MysqlDB}.gz $PostgresqlDB # Save all the mysql databases - do it in 2 parts to lower the load on the server. $MySQLDump -u root -pf1retrust > ${ArchiveDir}/$MysqlDB $Gzip ${ArchiveDir}/$MysqlDB # Create a new backup set $Tar --file=${ArchiveDir}/$Archive $ExcludeDirs $Dirs >> ${ArchiveDir}/$List 2>/tmp/null $Gzip ${ArchiveDir}/$Archive $Gzip ${ArchiveDir}/$List # and postgres #$PGDumpAll -U postgres | $Gzip > ${ArchiveDir}/$PostgresqlDB # and save it across to the backup server #$Scp ${ArchiveDir}/$Archive ${BackupHost}:/backup/${HostName}/${DateStamp}.${Archive} #$Scp ${ArchiveDir}/$List ${BackupHost}:/backup/${HostName}/${DateStamp}.${List} #$Scp ${ArchiveDir}/$MysqlDB ${BackupHost}:/backup/${HostName}/${DateStamp}.$MysqlDB #$Scp ${ArchiveDir}/$PostgresqlDB ${BackupHost}:/backup/${HostName}/${DateStamp}.$PostgresqlDB # Now we've finished, unmount the share. cd / $Umount /backup --8<--
