killermist

rsync-backup.sh

Dec 31st, 2012
426
0
Never
12
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # expects that password-less SSH key based authentication has already
  4. # been configured on the client and server sides of the operation
  5. # otherwise expect to enter user's SSH password/passphrase several times
  6. # for commands passed to the server
  7. # Date examples imply that "today's" backup is being done 2011-10-29
  8.  
  9. # config
  10. ## host name of ssh/rsync server
  11. SYNCSERVER=torrents
  12. ## what to sync
  13. SYNCWHAT=/home/`whoami`  #'my' home directory
  14. ## where to sync it, as the server filestructure would recognize it
  15. BASEDIR=/mnt/torrent-pool/home-backups/`whoami`@`hostname`
  16. ## can be changed to taste if backups need to happen more often than daily, or whatever
  17. NOW=`date +%F`
  18. # end of config
  19.  
  20. WORKDIR=$BASEDIR/$NOW
  21. NOWDIR=$BASEDIR/now
  22. YESTERDIR=$BASEDIR/last
  23. # assumes that /backup-path/last was left pointing to /backup-path/2011-10-28
  24.  
  25. #setup
  26. ssh $SYNCSERVER mkdir -p $WORKDIR
  27. # ex. /backup-path/2011-10-29
  28. # may work without pre-creation, but why tempt fate?
  29. ssh $SYNCSERVER rm -fv $NOWDIR
  30. # ex. /backup-path/now
  31. ssh $SYNCSERVER ln -s $WORKDIR $NOWDIR
  32. # ex. /backup-path/2011-10-29 -> /backup-path/now
  33.  
  34. # act
  35. rsync -aHP $SYNCWHAT/ $SYNCSERVER:$NOWDIR/ --link-dest=$YESTERDIR/
  36.  
  37. # cleanup
  38. ssh $SYNCSERVER rm -fv $YESTERDIR
  39. # ex. /backup-path/last
  40. ssh $SYNCSERVER ln -s $WORKDIR $YESTERDIR
  41. # ex. /backup-path/2011-10-29 -> /backup-path/last
  42. # so that tomorrow (2011-10-30), 'today sync' will be 'yesterday sync'
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Mirwautov
    208 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment