Web app backup simple shell script

Backup Recently, the unofficial discussion board for students of my university department went down because of a misunderstanding with their hosting provider who also reassigned their machine to another customer wiping out all of their data. Now they restore the board but the last backup was dated back to last year so lots of data have been lost. Anyway, when one of the admins announced on facebook the board was up again, i ironically commented writing a small shell script that can be used to backup a simple mysql-based web application such as a discussion board or a CMS installation such as drupal, joomla, wp or whatever… But then i thought this happend more frequently than expected to people i know, so i decided to post that script here :)

#!/bin/bash
#-----------------------------------
# Web App. Dumb Backup Script
# http://www.n0on3.net
#-----------------------------------
$user='your-username-here'
$server='your-domain-name-here'
$appname='your-webapp-name-here'
$apppath='your-webapp-path-here'
$mysqluser='your-mysql-user-here'
$mysqlpassword='your-mysql-pwd-here'
$dbname='your-mysql-db-name-here'
#-----------------------------------
d=`date +'%d-%m-%y'`
ssh $user@$server "tar cjvf backup-$appname-$d-www.tar.bz2 $apppath"
ssh $user@$server "mysqldump -u $mysqluser
                  --password=$mysqlpassword $dbname
                  > backup-$appname-$d-db.sql"
scp $user@$server:$HOME/$user/backup-$appname-$d-www.tar.bz2 \
                  backup-$appname-$d-www.tar.bz2
scp $user@$server:$HOME/$user/backup-$appname-$d-db.sql \
                  backup-$appname-$d-db.sql
ssh $user@$server 'rm backup-$appname-$d-*'

Please notice that here you are using ssh login without password, that means you have to append your client machine public rsa id to your server authorized keys file.
But more important, here you are writing your database password in plaintext because the script must use it, so if you keep such a script on your client machine remember to encrypt it or to take any proper precaution ;)


Huge numbers




I’m preparing sheets for the Business Plan i’m going to present with a group of colleagues at the Innovation Lab that Roma Tre University organized. Huge numbers i’m coming to, made me remember this video. Every time i see that, just perceiving the growing of complexity we are living, i feel shivers. Don’t you ?


EH Miracle on Thirty-Hack Street A&W out

EH-MTHSAnswers and Winners for Ethical Hacker Network Christmas Contest Miracle on Thirty-Hack Street are out. Unfortunately my answer was not enough complete :D . Anyway, this is a nice chance to spread something on the most famous socnet users privacy management.

This is the answer i submitted on Jan 6 2010:

Read more


Google Maps Street View goes 3D

Do you own a pair of anaglyph glasses ? You probably know them because of the 3D-movies at the cinema, they’re pretty in fashion right now. Well, if you are that lucky, you can now enjoy Google Maps Street View in 3D! I don’t have the glasses, and i don’t know if it’s a late-to-go april fool, but … c’mon that’s amazing, isn’t it ? I think i’m going to see a 3D movie in some cinema where you can keep the glasses after the 3D projection just to try how this feels :P


Overview of the ExAlg Approach

In the context of the Information Management for the Web class i’m currently attending, students are occasionally asked to review some related or interesting scientific publication. This time, since we had been introduced to the ROADRUNNER project mantained by the database group at Roma Tre University, I and a couple of colleagues offered ourselves to review an approach for Extraction of Structured Data from Web Pages developed at Stanford University by Arvind Arasu and Hector Garcia-Molina. Here is the presentations we wrote down for the speech.



The original paper on this work can be reached here.


Sushi (27-03-2010)

I’m becoming better at preparing sushi u.u









Great dinner ^^



Return top

About me