Skip to content
This repository has been archived by the owner on May 4, 2020. It is now read-only.
/ hash-backup Public archive

A command line tool to backup and restore directories.

Notifications You must be signed in to change notification settings

sam-hunt/hash-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

hash-backup

A command line tool to backup and restore directories.

###Migrated from bitbucket:###

###How to run the program###

  1. Run from the command line e.g. '"Python" "mybackup.py" "Command" "Argument"' where:

    • "Python" is your local installed version of Python 3.4 (I used Anaconda)
    • "mybackup.py" is the absolute or relative path to my program's main module on your machine
    • "Command" is one of my program's valid commands. If you get this wrong, my program will set you right though!
    • "Argument" is specific to which myBackup Command you invoke. e.g. a directory or file pattern. Help is available on this.
  2. Or from Pycharm with a run configuration set up from run->edit configurations,
    and with "Command" "Argument"' in the script parameters text-box

  3. Valid commands are:

    • init
    • store <directory>
    • list [pattern]
    • test
    • get <filename-or-pattern>
    • restore [destination-directory]
    • help
  4. Entering an invalid command will prompt you to what the valid commands are and terminate the program

  5. Entering a valid command with invalid argument will also tell you why it was invalid, then terminate the program

  6. Init should be used before other commands, however ignoring this will just prompt you to do this

###Folders###

  • The program consists of 3 modules: mybackup.py, mkfilsig.py, and logger.py

  • Also there is this read-me file. There are no other files/folders.

  • The program output folder is hardcoded to '/myArchive' where '' is the expanded current user home directory

    • There is only one instance of this hard-coded path at the top of the mybackup.py folder.
      Feel free to change this at your leisure as all other paths which operate on the archive are relative to this
    • You should ensure the program has elevated privileges or sufficient permissions to write to specified directories
  • The program will tell you where it outputs files (current working directory etc) if you don't specify an optional one

###Interesting commits (?)###

  • b437596 test command implemented.
    Re-adding inconsistent files will fix them.

  • a045525 restore command implemented.
    Code is relatively clean, succinct and functional.

###Notable features###

  • Descriptive help function.
  • Switch construct in main rather than if-else ladder.
  • Re-adding inconsistent files fixes them.
  • Invalid commands reroutes to help.
  • Most exceptions are handled further up the call-stack in main instead.

###Future Improvements###

The ARCHIVE_PATH should be variable rather than hard-coded. This could be handled as an additional command-line parameter.

Python's gzip library implementation 'gz' could be used to save space by compressing backed up files.

About

A command line tool to backup and restore directories.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages