File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed
Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # info: schedule user backup
3+
4+ # ----------------------------------------------------------#
5+ # Variable&Function #
6+ # ----------------------------------------------------------#
7+
8+ # Argument defenition
9+ user=$1
10+
11+ # Importing variables
12+ source $VESTA /conf/vars.conf
13+ source $V_CONF /vesta.conf
14+ source $V_FUNC /shared.func
15+
16+
17+ # ----------------------------------------------------------#
18+ # Verifications #
19+ # ----------------------------------------------------------#
20+
21+ # Checking arg number
22+ check_args ' 1' " $# " ' user'
23+
24+ # Checking argument format
25+ format_validation ' user'
26+
27+ # Checking backup system is enabled
28+ is_system_enabled ' backup'
29+
30+ # Checking user
31+ is_user_valid
32+
33+ # Checking user backups
34+ is_backup_enabled
35+
36+
37+ # ----------------------------------------------------------#
38+ # Action #
39+ # ----------------------------------------------------------#
40+
41+ # Adding backup to pipe
42+ echo " $user " >> $V_QUEUE /backup.pipe
43+
44+
45+ # ----------------------------------------------------------#
46+ # Vesta #
47+ # ----------------------------------------------------------#
48+
49+ # Logging
50+ log_event ' system' " $V_EVENT "
51+
52+ exit
Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ traff_pipe() {
3636 bash $V_QUEUE /traffic.pipe
3737}
3838
39+ backup_pipe () {
40+ for user in $( cat $V_QUEUE /backup.pipe | sort | uniq ) ; do
41+ sed -i " /^$user $/d" $V_QUEUE /backup.pipe
42+ bash $V_BIN /v_backup_sys_user $user
43+ # Send notification to user
44+ done
45+ }
46+
3947
4048
4149# ----------------------------------------------------------#
You can’t perform that action at this time.
0 commit comments