kuldietercastel Mar 2nd, 2013 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- REM get.bat
- REM Gets all files from the toSend directory of the given username to the outputDir directory.
- REM Description:
- REM This script has to be used with the pscp.exe of the putty suite.
- REM You can find putty here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- REM Version: 1.0
- REM Author: Dieter Castel
- REM License: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
- REM See: http://creativecommons.org/licenses/by-nc-sa/3.0/ for more info.
- REM Variables
- REM Changes where the files will be coppied to.
- set outputDir=.\recieved
- REM Changes where the file will be copied from. Mind the wildcard to get all files.
- set remoteDir=/toSend/*
- @echo off
- REM Asks for your user name.
- set /p user="Enter your ssh user name:"
- echo "Retrieving all files in /home/student/%user%/toSend"
- REM Uses putty copy
- REM -v for verbose messaging
- REM -r to copy all directories recursivly
- REM -2 force to use ssh2
- REM -scp use the scp protocol
- REM -unsafe allow serverside wildcards
- pscp -v -r -2 -scp -unsafe %email@example.com:/home/student/%user%%remoteDir% %outputDir%
- REM Pause to show what happend.
RAW Paste Data