Giter Site home page Giter Site logo

paychex's Introduction

paychex coding challenge

A python script that automates copying files from remote Server A and transfers them to remote Server B Information used to login to the servers is pulled from a config.env file which should be created locally. For demo purposes, I set up to Ubuntu virtual machines locally using VM ware and installed ssh tools on both.

Requirements for this lab

  • Python3
  • VM WARE Software
  • UBUNTU ISO

SET UP Virtual Machines

  • Install ssh tools on virtual machines using apt command in terminal sudo apt install openssh-server
  • Open ssh on virtual machines sudo ufw allow ssh

MODULE REQUIREMENTS FOR PYTHON SCRIPT

  • need to install dotenv and pathlib to read from env file
  • need to install paramiko using pip3 (used to SSH into servers)
  • need to install scp module - used for securely copying files between servers. install using pip3 install (used to copy files) https://pypi.org/project/scp/

BELOW ARE IMPORT STATEMENTS OF REQUIRED MODULES. ALL NON NATIVE MODULES CAN BE INSTALLED USING PIP3

import re
import os
import subprocess
import paramiko
from dotenv import load_dotenv
from pathlib import Path
from scp import SCPClient
import glob 

This script requires a config.env in the same directory level as the copy.py file It should have the following values

config.env

USERNAME=usernameforservers
PASSWORD=password_for_servers
SERVER_1=ipaddress_of_source
SERVER_2=ipaddress_of_destination
SSH_PORT=port_for_ssh

paychex's People

Contributors

abefong54 avatar

Watchers

James Cloos avatar  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.