Those of us who manage servers know how important it is to have backups of everything… because, in case of a problem or failure, the backup will be our best friend and will help us restore the services 
Some time ago (several months ... quite a few months) here, configurations were not backed up on servers, logs or something like that automatically. And it just couldn't be like that haha, I considered using bacula, but… GOD!! for what I wanted this was too much, very very complicated in my opinion, if what you want is to simply make backups and save them (or send them to another server, or by email) there is no need to use Bacula, with a simple script all the problems are solved, hence I decided to make my own script and so I was more satisfied 
And precisely this script is the one that I share with you, I explain very briefly what it does:
- Create a folder where everything will be saved, and this folder is the one that will then be compressed.
- This folder will have the name of the year, month and present day, for example today that folder would be called: 2012-04-26
- Copy / etc / (and all its content) to that folder.
- Copy logs (/ var / log /) to that aforementioned folder.
- Export the MySQL databases that we have.
- Compress with a password (PASSWORD) that folder, compress it into RAR.
- Generate a file (data.info) with all the log of the above done (file copy log and compression to .rar), in addition to putting the size (in MBs) of the .RAR file, which I remind you, contains everything we decided to save.
- Delete the folder in which we put the files and then compressed, because if we already have this compressed folder, there is no need to also have it uncompressed.
- Send emails to administrators or people related to the server, informing that the backup was done correctly, and the file with the log of everything will be sent attached to that email (data.info.rar)
Obviously, this script is not to be executed and now haha, you must open it and change your MySQL password in it, because I do not know the root password of your databases LOL !!!, as well as change the emails to the They want the notification to be sent, because the emails I put are only for example.
If you want to compress it into .tar.gz and not in .rar (how the script is configured) there I left the commented line, it is just uncomment it and comment on the .rar. Likewise, if you want to copy by SSH (using SCP) the compressed file to another server or hosting, I also left the line at the end (it is commented), in it you must put the access data to your server or hosting (user and domain or server URL), but for this to work you must also configure SSH without password, since the script will not be able to access the server if it does not have access allowed on it.
Ah, if you want the email sending thing to work, you must have postfix installed on the server, almost all install postfix But well, the clarification is valid 
Although ... they could modify and use a script in Python that I left a while ago, but I think it would work a little more ^ - ^ U
And well, it only remains to leave the script:
VPS Backup Script
Remember that you have to give it execution permissions (chmod + x vps_backup-script.sh)
To get it to run every day at 10AM, they put this in a terminal:
echo "* 10 * * * root cd /root && ./vps_backup-script.sh" >> /etc/crontab && /etc/init.d/cron restart
Assuming the script is saved as: /root/vps_backup-script.sh
Ok enough, I don't want to make this seem too complicated, which it isn't haha, in reality this is something extremely simple, it's just that when you see it for the first time it can be a little scary 
If you have any doubts, questions or suggestions, please let me know, you know that I like to help 
regards
PD: I clarify that I am not and do not consider myself a programmer haha, not even close LOL!! I know that the script can be optimized a lot more, but well… I am not a programmer 