sad cow

web design, jQuery plugins, web tools and general stuff about the internet by matt squirrell.
not exactly unique but hopefully better...

RSS Feed

Lovely backups

Because I know I'm going to have to come back to this again, here's how to back up all your important stuff over FTP using wput.

# files
8 2 * * * root find . ! -type d | grep -v [folders_you_want_to_ignore] | wput -nv -a /home/matt/wput_file_backup.log -N -l10M --reupload --dont-continue /var/www/html/ ftp://[your_ftp_name]:[your_ftp_password]@[your_ftp_url]/backup/

# prepare DB
35 3 * * * root mysql -s -r -u [your_sql_username] -p[your_sql_password] -e 'show databases' | while read db; do mysqldump -u admin -p[@nyth1ng] $db -r /home/matt/dbbackup/${db}.sql; [[ $? -eq 0 ]] && gzip -f /home/matt/dbbackup/${db}.sql; done

# weekly DB backup
8 4 * * 2 root cp -R /home/matt/dbbackup/ /home/matt/dbbackup_weekly/
# monthly DB backup
12 4 1 * * root cp -R /home/matt/dbbackup/ /home/matt/dbbackup_monthly/

#backup DB
8 5 * * * root wput -nv -a /home/matt/wput_db_backup.log -N -l5M --reupload --dont-continue /home/matt/dbbackup/ ftp://[your_ftp_name]:[your_ftp_password]@[your_ftp_url]/backup/
38 5 * * 2 root wput -nv -a /home/matt/wput_db_backup_weekly.log -N -l5M --reupload --dont-continue /home/matt/dbbackup_weekly/ ftp://[your_ftp_name]:[your_ftp_password]@[your_ftp_url]/backup/
38 5 1 * * root wput -nv -a /home/matt/wput_db_backup_monthly.log -N -l35M --reupload --dont-continue /home/matt/dbbackup_monthly/ ftp://[your_ftp_name]:[your_ftp_password]@[your_ftp_url]/backup/

Slide To Fit jQuery plugin

I am Matt Squirrell.

And this is the sort of thing I do.

I can design and build rich, feature-filled websites like this one. Ask me nicely and I might even do it with less than 700KB of images.

I started this website because I'm constantly coming up with neat little fixes, chunks of code, plugins or tricks, and then forgetting about them in a week. This is as much for me as it is for you (but it certainly is nice to share bits and pieces with other people).

It will also serve as a central point for all the other things I have done that have found their way to the Internet - from strange MMO God-sims to a 'Choose your own adventure' maker.

You are more than welcome to hire me if you've got your own web project you want to do - if you can think it I can pretty much make it. I'm cheaper than paying someone from the bargain basement to do it and then having to pay someone good to fix all the problems, too!

Anyway, until I think of a better way to sign off, I only hope you found something useful up there above ground.

Click on the cow ;o)

Contact me. If you like.

Valid XHTML 1.1