Browse Source

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

tags/v1.1.0^0
Robin Thoni 5 years ago
parent
commit
db08443a73
2 changed files with 7 additions and 5 deletions
  1. 4
    4
      rsnapshot/config/rsnapshot.cron.conf
  2. 3
    1
      rsnapshot/run.sh

+ 4
- 4
rsnapshot/config/rsnapshot.cron.conf View File

5
 # To activate this cron file you have to uncomment the lines below.
5
 # To activate this cron file you have to uncomment the lines below.
6
 # Feel free to adapt it to your needs.
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 View File

4
 
4
 
5
 replace_files
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…
Cancel
Save