Giter Club home page Giter Club logo

e82_scripts's Introduction

Autocopy

This code is written by @jepio.

Autocopy is a python script that periodically transfers data from a local folder to a remote location. It's primary design goal is moving files from Windows machines to Unix ones.

Deployment

  1. Right click and run the attached powershell script getstuff.ps1 which will download the neccessary putty components as well as python.
    • if this does not work ootb launch a powershell instance with powershell.exe -ExecutionPolicy Unrestricted.
    • if you can't find the files they will probably be in the current users home directory (C:\Users\User), sorry.
  2. Launch puttygen.exe, generate a key pair, save the private key somehwere, copy the public key in the grey text box into your clipboard (OpenSSH public key).
  3. Log into your remote using putty.exe and append the OpenSSH key to .ssh/authorized_keys (e.g. by doing echo "<right mouse click>" >> .ssh/authorized_keys)
  4. Launch pagent.exe on your local machine and import the private key. You will now be able to log into your remote with putty without a password (and perform secure copies with no password too).
  5. Edit the autocopy.py file to suit your needs. You must check the global variables at the beginning to see if they are what you expect. Most importantly:
    • set PERIOD to how often in seconds you want to perform backups.
    • set HOST to "user@host", the remote host location.
    • set REMOTE_FOLDER to the folder to which you want to copy. It must exist, and it should be a path relative to the users home folder. The posixpath.join function should be used with longer paths.
    • set PATH_TO_DATA to the desired path, using os.path.join. This is the folder that will be monitored.
  6. Launch autocopy.py and observe the log file to see what's happening.

Warning

If you previously used putty and have set it to keep a log, be careful because pscp will also follow this setting and if you chose full ssh packet log the log size may get out of hand.

Other than that, enjoy!

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.