PySync: the simple backup
December 8th, 2007
December 8th, 2007
Edit: There is better way to synchronize files, using bash scripts and rsync. This Python implementation is functional and can serve as a code example but for syncing files on my computer i’ll use bash and rsync.
PySync is my first useful application written in Python.
PySync can keep content of two folders synchronized. You can choose one or more folder pairs to keep in sync. You can make backup of important documents, music or source files, update data from your memory stick to your computer or synchronize files over network.
Current version: PySync 0.2
Download: ZIP
Guide
- Download and extract to the folder of your choice.
- Open pysync.cfg and replace default directory pairs with your own
- You can add unlimited number of directory pairs
- Use # at the beginning of a line to comment (exclude from synchronizing)
- In terminal, run
python /[path to pysync]/sync.py
- use -s argument to just simulate backup or -e to actually transfer files, -l to write log file instead of terminal messages
- PySync is currently only “one way”, that is, can copy only from source to destination. If you change file in destination it will be overwritten. Option to copy whichever file is newer will soon be available.
- If you want to schedule pysync to run every day you can use anacron
- open anacron’s config file
/etc/anacrontab
and insert new line:
1 1 pysync usr/bin/python/[path to pysync]/sync.py -e
- open anacron’s config file
- I recommend to add this directories to config file:
/boot::/media/backup/filesystem/boot /home::/media/backup/filesystem/home
Features:
- Create copy of directory structure.
- Update modified files.
- More directory pairs can be set.
Requirements:
- Python installed
Features in development:
- GUI
- Two way synchronizing – newer file overwrites older one
Future features: