From ebd345c22dd757dc12749ecd424604f71980b991 Mon Sep 17 00:00:00 2001 From: Mike Peralta Date: Sat, 1 Sep 2018 05:16:04 -0700 Subject: [PATCH 1/7] Create README.md --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..92242fa --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# mikes-backup +A simple script utilizing rsync for both full and differential backups, and auto folder naming, over SSH + +Honestly this is more of a wrapper around rsync's beautiful functionality. It simply makes daily backups slightly easier by: +* Automatically choosing a *full* or *differential* backup type, based on whether it detects an existing *full* backup folder +* Automatically generate a folder based on today's date and time, so you can generate a great many *differential* backup folders without manually changing anything + +## Requirements +* rsync +* python3 +* Backup server accessible over SSH + +## Command Line Arguments +* ```--full``` Forces the script to run a *full* backup +* ```--differential``` Forces the script to run an *incremental* backup +* ```--log-dir ``` Let's you set the log output directory +* ```--source-dir ``` Specifies the local source directory +* ```--remote-host ``` Specifies the remote host, to send the backups to over ssh +* ```--remote-user ``` Specifies the remote username to use, when connecting to the remote host +* ```--remote-dir ``` Specifies the remote backup destination directory +* ```--ssh-key ``` Specifies the local ssh key to use for authentication + +## Questions +I realize these docs are sparse at best, so please send in questions if you have any, and I will try to update this file or create a Wiki if need be + From 6977ae1e5b39eb4fda223717727e4844dfaa34c5 Mon Sep 17 00:00:00 2001 From: Mike Peralta Date: Sat, 1 Sep 2018 05:16:26 -0700 Subject: [PATCH 2/7] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92242fa..7db0e4a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# mikes-backup -A simple script utilizing rsync for both full and differential backups, and auto folder naming, over SSH +# Mikes Backup +A simple python script utilizing rsync for both full and differential backups, and auto folder naming, over SSH Honestly this is more of a wrapper around rsync's beautiful functionality. It simply makes daily backups slightly easier by: * Automatically choosing a *full* or *differential* backup type, based on whether it detects an existing *full* backup folder From 18534678f0f600d9e8de8b7a7cc1fa2efd59f03c Mon Sep 17 00:00:00 2001 From: Mike Peralta Date: Sat, 1 Sep 2018 05:21:11 -0700 Subject: [PATCH 3/7] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7db0e4a..a56a739 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A simple python script utilizing rsync for both full and differential backups, and auto folder naming, over SSH Honestly this is more of a wrapper around rsync's beautiful functionality. It simply makes daily backups slightly easier by: -* Automatically choosing a *full* or *differential* backup type, based on whether it detects an existing *full* backup folder +* Automatically choosing a *full* or *differential* backup type, based on whether it detects an existing *full* backup folder at the remote end * Automatically generate a folder based on today's date and time, so you can generate a great many *differential* backup folders without manually changing anything ## Requirements @@ -10,6 +10,9 @@ Honestly this is more of a wrapper around rsync's beautiful functionality. It si * python3 * Backup server accessible over SSH +## Assumptions +* Your backup destination is an SSH server + ## Command Line Arguments * ```--full``` Forces the script to run a *full* backup * ```--differential``` Forces the script to run an *incremental* backup @@ -19,6 +22,13 @@ Honestly this is more of a wrapper around rsync's beautiful functionality. It si * ```--remote-user ``` Specifies the remote username to use, when connecting to the remote host * ```--remote-dir ``` Specifies the remote backup destination directory * ```--ssh-key ``` Specifies the local ssh key to use for authentication +* ```--exclude ``` Specifies a source directory to exclude (can be passed multiple times) + +## Example +For daily use, you'll probably want to create a small bash script that calls this script with the parameters you want, and then call that with cron daily (or whatever your preference is) +```#!/bin/bash + +/path/to/mikes-backup --log-dir "/my/log/dir" --source-dir "/home/or/whatever" --remote-host "my-awesome-host.home" --remote-user "me" --remote-dir "/path/to/backup/destination/on/remote/" --ssh-key "/home/me/.ssh/id_rsa" --exclude "/my/dumb/downloads"``` ## Questions I realize these docs are sparse at best, so please send in questions if you have any, and I will try to update this file or create a Wiki if need be From a7bcdf3f9a0eecd018902b326e1816ecc1b0435f Mon Sep 17 00:00:00 2001 From: Mike Peralta Date: Sat, 1 Sep 2018 05:21:39 -0700 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a56a739..20f8f34 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Honestly this is more of a wrapper around rsync's beautiful functionality. It si ## Command Line Arguments * ```--full``` Forces the script to run a *full* backup -* ```--differential``` Forces the script to run an *incremental* backup +* ```--differential``` Forces the script to run a *differential* backup * ```--log-dir ``` Let's you set the log output directory * ```--source-dir ``` Specifies the local source directory * ```--remote-host ``` Specifies the remote host, to send the backups to over ssh From 054ca42974bf83c85d42531f2bdd73b6870e7822 Mon Sep 17 00:00:00 2001 From: Mike Peralta Date: Sat, 1 Sep 2018 05:22:10 -0700 Subject: [PATCH 5/7] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 20f8f34..45431a5 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,8 @@ Honestly this is more of a wrapper around rsync's beautiful functionality. It si For daily use, you'll probably want to create a small bash script that calls this script with the parameters you want, and then call that with cron daily (or whatever your preference is) ```#!/bin/bash -/path/to/mikes-backup --log-dir "/my/log/dir" --source-dir "/home/or/whatever" --remote-host "my-awesome-host.home" --remote-user "me" --remote-dir "/path/to/backup/destination/on/remote/" --ssh-key "/home/me/.ssh/id_rsa" --exclude "/my/dumb/downloads"``` +/path/to/mikes-backup --log-dir "/my/log/dir" --source-dir "/home/or/whatever" --remote-host "my-awesome-host.home" --remote-user "me" --remote-dir "/path/to/backup/destination/on/remote/" --ssh-key "/home/me/.ssh/id_rsa" --exclude "/my/dumb/downloads" +``` ## Questions I realize these docs are sparse at best, so please send in questions if you have any, and I will try to update this file or create a Wiki if need be From a042de9aa5e49d21da040149237ba50c436ca34c Mon Sep 17 00:00:00 2001 From: Mike Peralta Date: Sat, 1 Sep 2018 05:23:05 -0700 Subject: [PATCH 6/7] Update README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 45431a5..149106d 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,16 @@ Honestly this is more of a wrapper around rsync's beautiful functionality. It si For daily use, you'll probably want to create a small bash script that calls this script with the parameters you want, and then call that with cron daily (or whatever your preference is) ```#!/bin/bash -/path/to/mikes-backup --log-dir "/my/log/dir" --source-dir "/home/or/whatever" --remote-host "my-awesome-host.home" --remote-user "me" --remote-dir "/path/to/backup/destination/on/remote/" --ssh-key "/home/me/.ssh/id_rsa" --exclude "/my/dumb/downloads" +/path/to/mikes-backup \ + --log-dir "/my/log/dir" \ + --source-dir "/home/or/whatever" \ + --remote-host "my-awesome-host.home" \ + --remote-user "me" \ + --remote-dir "/path/to/backup/destination/on/remote/" \ + --ssh-key "/home/me/.ssh/id_rsa" \ + --exclude "/my/dumb/downloads" \ + --exclude "/my/even/dumber/downloads" + ``` ## Questions From 7f601f6d6280661822b7a771507a60395c5dc6a4 Mon Sep 17 00:00:00 2001 From: Mike Peralta Date: Sat, 1 Sep 2018 05:23:31 -0700 Subject: [PATCH 7/7] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 149106d..71a756a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ Honestly this is more of a wrapper around rsync's beautiful functionality. It si ## Example For daily use, you'll probably want to create a small bash script that calls this script with the parameters you want, and then call that with cron daily (or whatever your preference is) -```#!/bin/bash +``` +#!/bin/bash /path/to/mikes-backup \ --log-dir "/my/log/dir" \