Skip to content

Instantly share code, notes, and snippets.

@robot-o
Created June 20, 2017 05:41
Show Gist options
  • Save robot-o/417c83ea8e924ae45013ee8e6bebedf3 to your computer and use it in GitHub Desktop.
Save robot-o/417c83ea8e924ae45013ee8e6bebedf3 to your computer and use it in GitHub Desktop.

Revisions

  1. robot-o created this gist Jun 20, 2017.
    8 changes: 8 additions & 0 deletions khlavkala.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/bin/sh
    if [ -d "$1" ];
    then
    sudo rsync -aAXv --progress --exclude={"/files/*","/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/home/*/.cache/*","/home/*/Sync/*","/home/*/.mozilla/*"} / "$1";
    else
    echo $'usage:\n'$0' </path/to/target/directory>';
    echo $'\nError: invalid target directory, cancelling backup..';
    fi