Skip to content

Create backups of files and folders with a single Python command.

License

Notifications You must be signed in to change notification settings

neko-js/Python-Backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backup Tool in Python

This package is used for creating backups of directories and/or files by calling a single command within Python.

The directories are backuped by creating uncompressed and password protected archives with 7-zip. The archive name will be the same name as the directory or file being backed up.

This package is only for MS Windows.

See below for an example.

Installation

Installation is done via pip. Open command line and type in:

pip install git+https://github.com/smcgit/Python-Backup.git

To uninstall this package type in:

pip uninstall backup

Usage

After importing the module, following command can be used to backup folders within Python environment:

backup(paths_input, dir_output, pw)
  • paths_input is a list of directories or files to backup.
  • dir_output is an output directory for the 7z-files.
  • pw is the password for the 7z-files.

An example is given as such (save this as another Python file):

from backup import backup

# Specify input dirs/files and output directory here
paths_input = [
	'folder1',
	'../folder2',
	'C:/folder/file1.zip'
	]
dir_output = 'D:/Backup'

print('A password is needed for the backup files.')
pw = input('Enter a password: ')

backup(paths_input, dir_output, pw)

input('Press Enter to exit...')

About

Create backups of files and folders with a single Python command.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages