Last active
April 1, 2019 09:14
-
-
Save dgpro/16fd9bb5c8b426293f06690f52c8fe17 to your computer and use it in GitHub Desktop.
SSH Script to import the latest backup file from remote server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# import ip config | |
source ${BASH_SOURCE[0]%/*}/ip.conf | |
ssh root@$ip ls -t /root/backups/*backup.gz | head -n1 | awk '{printf("%s",$0)}' | cat > backup.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment