-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoinit_gestern.sh
executable file
·107 lines (80 loc) · 4.03 KB
/
autoinit_gestern.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
# Skript: autoinit.sh
# Globale Variablen
SCRIPTNAME=$(basename $0 .sh)
EXIT_SUCCESS=0
EXIT_FAILURE=1
EXIT_ERROR=2
EXIT_BUG=10
source ${0%/*}/config
grep -o 'zones=.' ${0%/*}/config
#head ${0%/*}/config
echo ""
#sqlite3 $database "select id,name,zone,dateAdded,expiration from infos where date(lastModified)>\"`date -d \"5 days\" +%Y-%m-%d`\"\";"
#diff -q /media/daten/bin/infosystem /mnt/ftp/infosystem/infosystem
#ls -ahl $database /mnt/ftp/infosystem/infosystem
if [ -e leave_mobile_mode.sql ] ; then
sqlite3 $database < leave_mobile_mode.sql 2> /dev/null
fi
read -n 1 -p "view/edit config before? (Y/n) " choice
if [[ $choice == "n" ]] ; then
echo ""
echo "existing config will be used"
else
$EDITOR ${0%/*}/config
source ${0%/*}/config
fi
msearch_opt_args="-pkjr40" #example "-v"
add_category_dirs
echo msearch_opt_args=$msearch_opt_args
echo "---------------------------------------------------------------------------"
echo ""
echo -e "\E[36m Additions same Day other Year : "; tput sgr0
echo "---------------------------------------------------------------------------"
echo ""
#msearch $msearch_opt_args -i l -d" like '`date +%%-%m-%d\'\ and\ Date\(DateAdded\)!=\'%Y-%m-%d`'"
#msearch $msearch_opt_args -i -l -d" like '`date +%%-%m-%d`' and Date(date)!='`date +%Y-%m-%d`'"
msearch $msearch_opt_args -i -l -d" like '`date -d "1 day ago" +%%-%m-%d`'" -w "Date(date)!='`date -d "1 day ago" +%Y-%m-%d`' and Date(dateAdded)!='`date -d "1 day ago" +%Y-%m-%d`'"
echo "---------------------------------------------------------------------------"
echo ""
echo -e "\E[36m Additions same day of the week but other Year: "; tput sgr0
echo "---------------------------------------------------------------------------"
echo ""
#msearch $msearch_opt_args -i -l -d" like '`date -d "8 days" +%%-%m-%d`' and Date(date)!='`date -d "8 days" +%Y-%m-%d`'"
msearch $msearch_opt_args -i -l -d" like '`date -d "7 days" +%%-%m-%d`'" -w "Date(date)!='`date -d "7 days" +%Y-%m-%d`' and Date(dateAdded)!='`date -d "7 days" +%Y-%m-%d`'"
echo "---------------------------------------------------------------------------"
echo ""
echo -e "\E[36m Additions six month before: "; tput sgr0
echo "---------------------------------------------------------------------------"
echo ""
msearch $msearch_opt_args -i -l -d"='`date -d "6 month ago 1 day ago" +%Y-%m-%d`'"
echo "---------------------------------------------------------------------------"
echo ""
echo -e "\E[36m Additions one Month before: "; tput sgr0
echo "---------------------------------------------------------------------------"
echo ""
msearch $msearch_opt_args -i -l -d"='`date -d "last Month 1 day ago" +%Y-%m-%d`'" -x "done','monthly"
echo "---------------------------------------------------------------------------"
echo ""
echo -e "\E[36m Additions last week same day "; tput sgr0
echo "---------------------------------------------------------------------------"
echo ""
msearch $msearch_opt_args -i -l -d"='`date -d "8 days ago" +%Y-%m-%d`'" -x "done','monthly','beweekly','weekly"
echo "---------------------------------------------------------------------------"
echo ""
echo -e "\E[36m Additions 3 Days before: "; tput sgr0
echo "---------------------------------------------------------------------------"
echo ""
msearch $msearch_opt_args -i -l -d"='`date -d "4 days ago" +%Y-%m-%d`'" -x "done','monthly','biweekly','weekly"
#echo "---------------------------------------------------------------------------"
#echo ""
#echo -e "\E[36m Additions 2 days before: "; tput sgr0
#echo "---------------------------------------------------------------------------"
#echo ""
#msearch $msearch_opt_args -i -l -d"='`date -d "2 days ago" +%Y-%m-%d`'" -x "done','monthly','biweekly','weekly"
echo "---------------------------------------------------------------------------"
echo ""
echo -e "\E[36m Additions Yesterday: "; tput sgr0
echo "---------------------------------------------------------------------------"
echo ""
msearch $msearch_opt_args -i -l -d"='`date -d "2 days ago" +%Y-%m-%d`'" -x "done','monthly','biweekly','weekly"