Skip to content

Commit 3bd79ec

Browse files
committed
Added support for month daily backups
1 parent 19f8274 commit 3bd79ec

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

backup.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# URL: https://github.com/zevilz/WebServerCloudBackups
44
# Author: zEvilz
55
# License: MIT
6-
# Version: 1.9.2
6+
# Version: 1.10.0
77

88
checkFilePermissions()
99
{
@@ -64,7 +64,7 @@ if [[ $# -lt 2 ]]; then
6464
$SETCOLOR_FAILURE
6565
echo "Wrong number of parameters!"
6666
$SETCOLOR_NORMAL
67-
echo "Usage: bash $0 files|bases hourly|daily|weekly|monthly 0|1|3|5|7|9(optional) webdav|s3|ssh(optional)"
67+
echo "Usage: bash $0 files|bases hourly|daily|daily_week|daily_month|weekly|monthly 0|1|3|5|7|9(optional) webdav|s3|ssh(optional)"
6868

6969
exit 1
7070
fi
@@ -80,13 +80,13 @@ if [[ $1 != "files" && $1 != "bases" ]]; then
8080
exit 1
8181
fi
8282

83-
if [[ $2 != "hourly" && $2 != "daily" && $2 != "weekly" && $2 != "monthly" ]]; then
83+
if [[ $2 != "hourly" && $2 != "daily" && $2 != "daily_week" && $2 != "daily_month" && $2 != "weekly" && $2 != "monthly" ]]; then
8484
pushToLog "[ERROR] - Wrong period set"
8585

8686
$SETCOLOR_FAILURE
8787
echo "Wrong period set!"
8888
$SETCOLOR_NORMAL
89-
echo "Period must be set to \"hourly\" or \"daily\" or \"weekly\" or \"monthly\""
89+
echo "Period must be set to \"hourly\" or \"daily\" or \"daily_week\" or \"daily_month\" or \"weekly\" or \"monthly\""
9090

9191
exit 1
9292
fi
@@ -143,8 +143,10 @@ fi
143143
# period time postfix
144144
if [[ $2 == "hourly" ]]; then
145145
PERIOD="$2"_$(date +"%H")
146-
elif [[ $2 == "daily" ]]; then
146+
elif [[ $2 == "daily" || $2 == "daily_week" ]]; then
147147
PERIOD=$(date +"%u")_$(date +"%A")
148+
elif [[ $2 == "daily_month" ]]; then
149+
PERIOD="$2"_$(date +"%d")
148150
else
149151
PERIOD="$2"
150152
fi

0 commit comments

Comments
 (0)