Commit Diff


commit - 91c75d9a5eaf40631fa128dc30452e4a3184a242
commit + 0da605df6f1d2c7759af871153259ace75dda192
blob - 61f09e9a2b3385f35ed013882c45f2e69879348d
blob + f935fd09eef2450be8310c1be31ea6395e8da529
--- vdcron
+++ vdcron
@@ -12,6 +12,7 @@
 DEBUG=
 SLEEP=10
 TEMP=$(mktemp)
+FILE=
 USAGE="$0 <options> \n
       options are:\n
         -h        : this help\n
@@ -36,12 +37,12 @@ while getopts "$PARAMS" optchar; do
 done
 
 if [ $(id -u) -eq 0 ]; then
-    FILE="/etc/vdcron.conf"
+    [ ! -n "$FILE" ] && FILE="/etc/vdcron.conf"
     LOG="/var/log/vdcron.log"
     mkdir -p "$(dirname "$FILE")" && touch "$FILE"
     touch "$LOG"
 else
-    FILE="$HOME/.vdcron/vdcron.conf"
+    [ ! -n "$FILE" ] && FILE="$HOME/.vdcron/vdcron.conf"
     LOG="$HOME/.vdcron/vdcron.log"
     mkdir -p "$(dirname "$LOG")" && touch "$LOG"
 fi
@@ -109,7 +110,7 @@ while IFS="" read -r line; do
         elif [ "$filedate" -eq "$CURRENT_DATE" ]; then
             EXEC="YES"; REMOVE="YES"; _step=86400;_datefmt="%Y%m%d"
         elif [ "$filedate" -eq "$CURRENT_DATETIME" ]; then
-            EXEC="YES"; REMOVE="YES"; _step=60;_datefmt="%y%m%d%H%M"
+            EXEC="YES"; REMOVE="YES"; _step=60;_datefmt="%Y%m%d%H%M"
         fi  
     elif [ "$filedate" = "Always" ]; then
         EXEC="YES"