GithubHelp home page GithubHelp logo

cron-auto-push's Introduction

Cron-Auto-Push

A script to automate pushing from a local *nix system to a remote Git server over HTTP(S). SSH coming soon!

Installation:

  • Automated:

    1. Run the following command:
      • bash setup.sh OR
      • ./setup.sh if permissions are set correctly.
        • By default the setup script is executable.
    2. Fill out the information that the script will prompt you for.
      • Here is a screenshot of the information that I would fill out for this repository:
        • Screenshot Cron-Auto-Push User Info Example
    3. The cronjob will now automatically be created for you.
      In the future, the setup script will input a crontab for you. The workaround for now is to follow steps 3 and 4 in the Manual section
  • Manual:

    • Follow these steps to install the script:
      1. Edit lines 3 to 6 in auto-push.sh to the update the relevant variables
      2. Make your script executable by typing the following command:
        • chmod a+x auto-push.sh
      3. Fire up a bash shall and type the following command:
        • crontab -e
      4. Input the following line of code to set-up a cron job that runs every minute:
        • * * * * * ~/path/to/file/auto-push.sh
        • NOTE: Because the script limits the user to auto-committing once a day and cron jobs do not run when the user's computer is off or asleep, setting up a cron job that runs every minute will only auto-commit once per day but will still check every minute.

Usage:

  • To manually run the script, input the following line of code in your bash shell:

    • bash auto-push.sh -o OR
    • ./auto-push.sh -o if permissions are set correclty
  • Otherwise, if the script is installed correctly, it will be run periodically through a cronjob

  • Possible Use Cases:

    • For the forgetful developer, like myself, this script can be used to commit/push nightly (ideally to a non-critical branch).
    • Although git and Github really should not be used as backup software, one could potentially use this script to periodically back up a directory on their local *nix based system to the Github server.

cron-auto-push's People

Contributors

backwardjet 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.