Admins eHow SysAdmin Tips & Tricks

May 4, 2011

Backup Files or MySQL DBs to a remote FTP server with compression and encryption

Filed under: CentOS,Debian,General,linux,Security — Tags: , , , , , , , — admin @ 6:30 pm

After my previous article which explained how to backup MySQL DBs to an email address , I am going to provide a more perfect solution in this article 🙂
The previous solution had some drawbacks and some advantages but the biggest problem was about the size of backup. although we compress the data with bzip2 algorithm which provides a high level of compression but in many cases, the attachment size will exceed 25MB or the limit of your email box. so it can not be used with public email services or will need a personal email server.
a better solution is to backup the data to a remote FTP server. in this case we will have almost no limit on file size (depending on your remote FTP server).
A perfect place to backup your files is fileserve.com , it offers 500GB of space for free and FTP access to it ! it is awesome ! I would recommend to upgrade to their premium service.
click on this link to signup for your free account : FileServe.com Free Account
also we will employ encryption to make sure our data is safe in transmit and in remote location.
to use this solution make sure bzip2, mcrypt and ncftp are installed on your server. I am not going into the details of installing each package, Google is your friend 🙂
so lets say you want to backup /var/www folder, use the following command :

tar jcf - /var/www | mcrypt -k 'SOME_LONG_COMPLEX_KEY' |  ncftpput -c -u FTP_USER -p FTP_PASS FTP_HOST /PREFIX-`date +%Y%m%d`

this only command will compress the whole /var/www folder by tar and bzip2 at the same time encrypt it by your key and at the same time will upload it to remote FTP server !
omg ! thats why I love Linux ! you can put it in your crontab to create automatic backups.
now lets say you want to backup all MySQL DBs , you can use the following command :

mysqldump --user=USERNAME --password=PASSWORD -A | bzip2 | mcrypt -k 'SOME_LONG_COMPLEX_KEY' |  ncftpput -c -u FTP_USER -p FTP_PASS FTP_HOST /PREFIX-`date +%Y%m%d`

the combinations and possibilities are limitless !
I just gave you the idea and showed you the power, use your own brain to make your perfect solution 😉
Just something else , if you needed to decrypt the file , you can use the following command :

mcrypt -d FILE_NAME -k 'YOUR_LONG_COMPLEX_KEY' > NEW_FILE_NAME

May 3, 2009

How to download files from FTP account easily Using FireFox + Flashgot + Flashget

Filed under: General — Tags: , , , , — admin @ 5:35 pm

ftp5

I have a Torrent Hosting service from a site named LeaseTorrent.com , I am almost 2 years with them and they are really good 🙂 anyway it is not a review for them but I want to teach you how to use combination of Firefox + Flashgot + Flashget to download your files easily from any FTP server.

You need these tools :

FlashGet version 1.73 , download here ( dont download newer versions , they are full of ads and crap )
Lates version of Firefox , download here
Latest version of Flashgot extension , download here

download these softwares and install them on your PC , remember flashgot is an addon for Firefox.

after installations , access your FTP account by this url in Firefox : ftp://username:password@yourftphost.com
you will see something like this :

ftp1

enter any folder which you want to download its files , and right click on page and choose Flashget All :

ftp2

uncheck the first two options and click on OK :

ftp3

on the next page specify where you want the files to be saved and click on OK.

ftp4

it’s done 🙂 all of your files will be added into flashgot queue and downloaded into the folder which you specified.

Powered by WordPress