Skip to content

Instantly share code, notes, and snippets.

@rhamdeew
Created January 16, 2014 23:32
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 rhamdeew/8465583 to your computer and use it in GitHub Desktop.
Save rhamdeew/8465583 to your computer and use it in GitHub Desktop.
use rsync for local sync use lftp for upload to selectel
#!/bin/bash
CURRENTDATE=$(date +%Y-%m-%d)
rm -rf /var/backups/selectel/*
find /var/backups/local/ -name admin-1_full-$CURRENTDATE.tar.gz -printf "%h\n"| xargs -i{} basename {} | xargs -i{} echo {}/admin-1_full-$CURRENTDATE.tar.gz > file.lst
rsync -a /var/backups/local /var/backups/selectel/ --files-from=file.lst
rm file.lst
/usr/bin/lftp -f /root/selectel_backup.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment