Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
133a6b1a48 | |||
584532e2c7 | |||
97d1a14260 | |||
71a2b6d01e | |||
6649925ec9 | |||
871c8d6543 |
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#Help function
|
#Help function
|
||||||
function help_function {
|
function help_function {
|
||||||
echo "simple_backup, version 1.3.3"
|
echo "simple_backup, version 1.4.1"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Usage: $0 [OPTIONS]"
|
echo "Usage: $0 [OPTIONS]"
|
||||||
echo ""
|
echo ""
|
||||||
@ -36,8 +36,8 @@ function help_function {
|
|||||||
echo " Default: keep all."
|
echo " Default: keep all."
|
||||||
echo "-u, --user USER User performing the backup."
|
echo "-u, --user USER User performing the backup."
|
||||||
echo " Default: current user."
|
echo " Default: current user."
|
||||||
echo " WARNING: This currently doesn't work with"
|
echo "-s, --checksum Use the checksum rsync option to compare files"
|
||||||
echo " other options!"
|
echo " (MUCH slower)."
|
||||||
echo ""
|
echo ""
|
||||||
echo "If no option is given, the program uses the default"
|
echo "If no option is given, the program uses the default"
|
||||||
echo "configuration file: $HOMEDIR/.simple_backup/config."
|
echo "configuration file: $HOMEDIR/.simple_backup/config."
|
||||||
@ -299,6 +299,10 @@ function parse_options {
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-s | --checksum)
|
||||||
|
OPTIONS="-arcvh -H -X -R"
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo "$(date): Backup failed (see errors.log)" >> $LOG
|
echo "$(date): Backup failed (see errors.log)" >> $LOG
|
||||||
echo "Backup failed"
|
echo "Backup failed"
|
||||||
@ -331,7 +335,7 @@ ERR=$(mktemp)
|
|||||||
WARN=$(mktemp)
|
WARN=$(mktemp)
|
||||||
|
|
||||||
HOMEDIR="$HOME"
|
HOMEDIR="$HOME"
|
||||||
OPTIONS="-arv -H -X -R"
|
OPTIONS="-arvh -H -X -R"
|
||||||
|
|
||||||
#Check number of parameters
|
#Check number of parameters
|
||||||
if [[ "$#" -eq 0 ]]; then
|
if [[ "$#" -eq 0 ]]; then
|
||||||
@ -348,7 +352,7 @@ if [[ "$#" -eq 0 ]]; then
|
|||||||
|
|
||||||
read_conf
|
read_conf
|
||||||
else
|
else
|
||||||
parse_options $@
|
parse_options "$@"
|
||||||
|
|
||||||
if [[ $n_in -gt 0 && ( -z $BACKUP_DIR || ! -d $BACKUP_DIR ) ]]; then
|
if [[ $n_in -gt 0 && ( -z $BACKUP_DIR || ! -d $BACKUP_DIR ) ]]; then
|
||||||
#If the backup directory is not set or doesn't exist, exit
|
#If the backup directory is not set or doesn't exist, exit
|
||||||
|
Reference in New Issue
Block a user