https://github.com/StudyResearchProjects/scp-scorpion
🦂 Secure Copy Protocol (scp) script to automate transfer process
https://github.com/StudyResearchProjects/scp-scorpion
bash file-transfer python scp
Last synced: 4 months ago
JSON representation
🦂 Secure Copy Protocol (scp) script to automate transfer process
- Host: GitHub
- URL: https://github.com/StudyResearchProjects/scp-scorpion
- Owner: StudyResearchProjects
- License: mit
- Archived: true
- Created: 2019-08-15T02:51:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-15T04:52:57.000Z (over 6 years ago)
- Last Synced: 2025-09-13T04:52:15.953Z (5 months ago)
- Topics: bash, file-transfer, python, scp
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# scorpion
🦂 Secure Copy Protocol (scp) script to automate transfer process
Named after `scp` (Security Copy Protocol) bash command as **sc**or**p**ion, automate the sharing process using a config file.
Scorpion is a script that runs `ssh` and `scp` in order to accomplish the following tasks:
1. Delete existing `target` directory.
2. Create the previously removed directory.
3. Copy contents from `origin` directory to `target` directory.
`target` directory and `origin` directory are paths specified in a json file called `scorpion.json`.
The script logs every command and asks for `sudo` before executing it.
The following is a sample of the commands `scorpion` runs in order to accomplish its tasks.
```bash
[SCORPION] :: Running $ ssh admin@0.0.0.0 rmdir /www/website.com/
# (asks for sudo)
[SCORPION] :: Running $ ssh admin@0.0.0.0 mkdir -p /www/website.com/
# (asks for sudo)
[SCORPION] :: Running $ scp -r ./dist/* admin@0.0.0.0:/www/website.com/
# (asks for sudo)
```
## Requirements
- Python 3.7
## Installation
To download `scorpion.py` script, run **cURL** from your project directory as follows:
```bash
curl -L https://raw.githubusercontent.com/estebanborai/scp-scorpion/master/scorpion/scorpion.py >> scorpion.py
```
## Usage
Run scorpion from you project root directory as follows:
```bash
python ./scorpion.py
```
In order to run `scorpion`, a config file should be available in the context of the process.
The following is an example of a `scorpion.json`.
```javascript
{
"user": "admin", // The address user
"address": "0.0.0.0", // The address to copy files (IP)
"origin": "./dist/*", // The files to copy
"target": "/www/website.com/" // The target path of the files
}
```
If the `scorpion.json` file is not available, the user will be prompted in order to generate a new configuration file.