File Backup With Python
A simple application for comparing and backing up files
It's been a while, still works (on my Windows 10 machine), but it's time to review the code.
Environment and System Configuration
Built in Windows 7 with Python 3. Only tested in a windows environment. There may be issues in other environments due to the '/' and '\' difference between Windows and Unix based systems.
Python 3 can be downloaded from https://www.python.org/ The GUI was built using the Tkinter package which is included in the Windows python download.
Application Installation Instructions
Clone or download this repository
Navigate to the backup folder in the repository. There should be one file
backup.py. Run it with:
$ python3 backup.py
This will open a graphical interface and users can select a
Destination folder and choose to:
ListOutputs the list of files in the source folder
CompareCompare the files in the source and destination folders and outputs a list of the files in the Source folder, flagging the ones that are not in the destination folder and therefore need to be backed up
CopyCompare the files in the source and destination folders and if the source folder has a newer copy of a file (or the file doesn't exist in the destination folder), copy the file from the source folder to the destination folder and also output a log
Logs are output to
stdout and time-stamped text files a
Overview and Discussion
This was a personal project both to learn and use Python but also because I had wanted a file-copy/backup program that did exactly what I wanted. Most of the programs available had a lot of extra features I did not need. Building this project I learnt about manipulating file systems, GUI interfaces in python and classes. I use this to compare and backup files from my laptop to external storage.
It compares files based on file names and the time it was last modified. I have not tried using this for large sets of files.