tag: backup

Duplicity and Hubic

2 Jan, 2016 - 1 minutes
Install the dependencies (See note at end). sudo apt-get install duplicity sudo pip install pyrax Create a ~/.hubic_credentials with the format below. Get the client ID and secret from the Hubic website under ‘My Account -> Developers’, add an application with a descriptive name and set the redirect domain to ‘http://localhost/. [hubic] email = <hubicemailaddress> password = <hubicpassword> client_id = <hubicclientid> client_secret = <hubicclientsecret> redirect_uri = http://localhost/ You should now be able to use duplicity to backup to the Hubic storage.

Clone a Harddrive Linux

4 Mar, 2012 - 1 minutes
Using dd you can make a bit for bit clone of a harddrive/partition. dd takes two parameters. if, the source and of, the destination. dd if=/dev/sda of=~/backup.img This will make a copy of the entire disk, if you were to put sda1 you’d get the first partition. Make sure to only run these commands when there is no activitiy on the disk. If you are using LVM you can make a snapshot of the data and run it against that.

Restoring MySQL from data files

18 Feb, 2012 - 1 minutes
MySQL stores all its data in the following location /var/lib/mysql/<database> Simply make a copy of these files and you have a backup, when restoring make sure its owned by mysql.

MySQL Backup/Restore database

18 Dec, 2011 - 1 minutes
The following command will back up your MySQL database to a file. mysqldump --add-drop-table -u user -p database > outputfile.sql The following will restore your database. mysql -u root -p database < outputfile.sql Or for a complete server back up and compression: mysqldump -u root -p --all-databases | gzip > output.sql.gz