Code Monkey home page Code Monkey logo

pys3sb's Introduction

pyS3sb

pyS3sb is a Python rewrite of s3sb, a basic shell script package to back up files and databases to Amazon S3.

Copy/rename config-sample.py to config.py and tune the values as desired. If using a shared hosting environment, please remember to check the permissions for config.py to ensure it can’t be read by other users if necessary. $ chmod 600 config.py should do the trick.

Prerequisites: mysqldump and gzip; Python 3; and boto3 in your environment. If you have pip installed, run pip install -r REQUIREMENTS in the pyS3sb directory to automagically install boto3. See the python2 branch for a legacy version of the tool that uses Python 2.

pyS3sb is designed to work in tandem with cron. Set up cron jobs to call pys3sb with the --daily, --weekly and --monthly options, something like this:

0 0 * * * cd /path/to/pys3sb; python s3sb.py --daily
0 0 * * 0 cd /path/to/pys3sb; python s3sb.py --weekly
0 0 1 * * cd /path/to/pys3sb; python s3sb.py --monthly

This will call pyS3sb at the appropriate times and run tasks according to their defined frequency in the config file. Depending on how your environment is set up, you may need to adjust your $PATH or invoke your .bashrc file to ensure cron runs the right version of Python, e.g:

0 0 * * * source ~/.bashrc; cd /path/to/pys3sb; python s3sb.py --daily

You can also specify that a single task be run using the --only option, which must be combined with the frequency of the task you wish to run. For example, to run a task named blog-backup which would normally run daily, you could run:

$ python s3sb.py --daily --only blog-backup

You can also use the --test option which will check your config file without running any tasks.

pyS3sb is a work in progress, so please stay tuned.

pys3sb's People

Contributors

biggleszx avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.