Skip to main content

Backup and restore for linux

Project description

Backup and restore for linux

This library is targeting to help writing backup, restoration and configuration scripts with minimum effort.

Example Usages

Backing up folders or files

from linuxbackup import *
folder(['/var/www','/var/log'])
folder('/home/ubuntu/test',owner='ubuntu:ubuntu',permission='777')

Execute the script with argument backup or restore

python3 example.py backup
sudo python3 example.py restore

Executing shell

sh(cmd,check) is the same as subprocess.run(cmd,shell=True,check=check) shr is the same as sh except it only runs in RESTORE

sh('./test.sh')
shr('curl https://get.acme.sh | sh')

Editing php.ini

php=IniEditor('/etc/php/7.2/apache2/php.ini')
php['PHP']['upload_max_filesize']='20M'
php.write() #only executed in RESTORE mode

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linuxbackup-0.0.1.tar.gz (2.3 kB view hashes)

Uploaded source

Built Distribution

linuxbackup-0.0.1-py3-none-any.whl (2.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page