pastebin - collaborative debugging tool
script.kpaste.net RSS


Untitled
Posted by Anonymous on Tue 3rd Mar 2015 01:51
raw | new post

  1. #!/bin/bash
  2.  
  3. # Backup script meant for backing up stuff that is not managed by $env
  4. # Usage: bash backup.sh /path/to/target/
  5.  
  6. # Requires: root privileges
  7. # Requires: deployment of environment
  8.  
  9.  
  10. # Set backup location here
  11. target=$1
  12. timestamp=$(date +%F_%T%z)
  13.  
  14. # Make a timestamped directory there.
  15. mkdir -v "$target"homeprofile_backup_"$timestamp"
  16.  
  17.  
  18. # Make what has been bade by mkdir and put that into a variable called $tdir.
  19. tdir="$target"homeprofile_backup_"$timestamp"/
  20.  
  21.  
  22. # rsync -avpPhR = rsync --archive --verbose --perms --partial --progress --human-readable --relative
  23.  
  24. # Backup Chromium profile
  25. rsync -avpPhR ~/.config/chromium "$tdir"
  26.  
  27. # Backup weechat stuff
  28. rsync -avpPhR ~/.weechat "$tdir"
  29.  
  30. # Backup SSH stuff
  31. rsync -avpPhR ~/.ssh /etc/ssh "$tdir"

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at