Skip to content

Instantly share code, notes, and snippets.

@dgpro
Last active April 1, 2019 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgpro/16fd9bb5c8b426293f06690f52c8fe17 to your computer and use it in GitHub Desktop.
Save dgpro/16fd9bb5c8b426293f06690f52c8fe17 to your computer and use it in GitHub Desktop.
SSH Script to import the latest backup file from remote server
#!/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