Advertisement
imehesz

Remote `scp` with `sshpass`

Feb 2nd, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | None | 0 0
  1. #!/bin/bash
  2. SSHPWDFILE="/path/to/your/password/file.txt"
  3. BACKUPFILE="backup-file-name-"`date '+%d-%m-%Y'`".tar.gz";
  4. REMOTEBACKUPFOLDER="/path/to/your/backups/on/the/remote/server/";
  5. LOCALBACKUPFOLDER="/path/to/your/backups/locally/";
  6. REMOTESERVERLOGIN="user@yourserver.com";
  7. sshpass -f $SSHPWDFILE scp $REMOTESERVERLOGIN:$REMOTEBACKUPFOLDER$BACKUPFILE $LOCALBACKUPFOLDER.;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement