Преглед на файлове

Save and load env for cron tasks; fixed monthly/weekly order

tags/v1.1.0^0
Robin Thoni преди 5 години
родител
ревизия
db08443a73
променени са 2 файла, в които са добавени 7 реда и са изтрити 5 реда
  1. 4
    4
      rsnapshot/config/rsnapshot.cron.conf
  2. 3
    1
      rsnapshot/run.sh

+ 4
- 4
rsnapshot/config/rsnapshot.cron.conf Целия файл

@@ -5,7 +5,7 @@
5 5
 # To activate this cron file you have to uncomment the lines below.
6 6
 # Feel free to adapt it to your needs.
7 7
 
8
-# 00 */4		* * *		root	/usr/bin/rsnapshot hourly
9
- 00  3  	* * *		root	/usr/bin/rsnapshot daily
10
- 50  2  	* * 1		root	/usr/bin/rsnapshot weekly
11
- 55  2  	1 * *		root	/usr/bin/rsnapshot monthly
8
+# 00 */4		* * *		root	. /tmp/env; /usr/bin/rsnapshot hourly
9
+ 00  3  	* * *		root	. /tmp/env; /usr/bin/rsnapshot daily
10
+ 55  2  	* * 1		root	. /tmp/env; /usr/bin/rsnapshot weekly
11
+ 50  2  	1 * *		root	. /tmp/env; /usr/bin/rsnapshot monthly

+ 3
- 1
rsnapshot/run.sh Целия файл

@@ -4,4 +4,6 @@
4 4
 
5 5
 replace_files
6 6
 
7
-cron -f
7
+env | grep -Ev 'BASHOPTS|BASH_VERSINFO|EUID|PPID|SHELLOPTS|UID' | sed 's/^\(.*\)$/export \1/' > /tmp/env
8
+
9
+cron -fn

Loading…
Отказ
Запис