...

Backup Tool

Backup Python Script

I created a very handy and light-weight python script that can be run on any unix-based host.

This script made my backup jobs very fast and easy. It helps you to run backups just with a few clicks.

 

About the script

You provide a csv file with three fields that each line of this file has information for each backup process.

File format is as following:

"Full_path_to_local_directory_1", "Full_path_to_target_directory_1_on_remote_server", "Backup_excluded_subfolders_list"

"Full_path_to_local_directory_2", "Full_path_to_target_directory_2_on_remote_server", "Backup_excluded_subfolders_list"

and so forth ...

 

Here is a sample of csv with backup information

 

Script reads this csv file and displays a menu to user. User selects the directories that require backup, from that menu.

The rest will be taken care by script. It generates script for archiving and transfering zipped files to remote server. Script has a user-friendly interface and interacts with user at each step if it is needed.

There are some global variable at the top of script, that can be changes by user optionally, but user is required to provide the IP address and the user name for the remote sftp server, as the target of backup.

 

To colorizing titles and messges in script output, I used "termcolor" python package, that is not a native python library module. You can ignore that, though you need to change all print() statements in the script to a simple print() method.

 

Script source