|
4 | 4 | $backup_path = $rsnapshot::params::server_backup_path,
|
5 | 5 | $log_path = $rsnapshot::params::server_log_path,
|
6 | 6 | $lock_path = $rsnapshot::params::lock_path,
|
7 |
| - $backup_user = $rsnapshot::params::server_user, |
8 |
| - $remote_user = $rsnapshot::params::client_user, |
| 7 | + $server_user = $rsnapshot::params::server_user, |
| 8 | + $client_user = $rsnapshot::params::client_user, |
9 | 9 | $directories = {},
|
10 | 10 | $includes = {},
|
11 | 11 | $excludes = {},
|
|
50 | 50 | $backup_path_norm = regsubst($backup_path, '\/$', '')
|
51 | 51 | $wrapper_path_norm = regsubst($wrapper_path, '\/$', '')
|
52 | 52 |
|
53 |
| - $user = $backup_user |
54 |
| - |
55 | 53 | $log_file = "${log_path_norm}/${name}-rsnapshot.log"
|
56 | 54 | $lock_file = "${lock_path_norm}/${name}-rsnapshot.pid"
|
57 | 55 | $config_file = "${config_path_norm}/${name}-rsnapshot.conf"
|
|
87 | 85 | ## hourly
|
88 | 86 | cron { "rsnapshot-${name}-hourly" :
|
89 | 87 | command => "${rsnapshot::server::cmd_rsnapshot} -c ${config_file} hourly",
|
90 |
| - user => 'root', |
| 88 | + user => $server_user, |
91 | 89 | hour => $backup_hourly_cron,
|
92 | 90 | minute => $backup_time_minute
|
93 | 91 | } ->
|
94 | 92 |
|
95 | 93 | ## daily
|
96 | 94 | cron { "rsnapshot-${name}-daily" :
|
97 | 95 | command => "${rsnapshot::server::cmd_rsnapshot} -c ${config_file} daily",
|
98 |
| - user => 'root', |
| 96 | + user => $server_user, |
99 | 97 | hour => $backup_time_hour,
|
100 | 98 | minute => $backup_time_minute
|
101 | 99 | } ->
|
102 | 100 |
|
103 | 101 | ## weekly
|
104 | 102 | cron { "rsnapshot-${name}-weekly" :
|
105 | 103 | command => "${rsnapshot::server::cmd_rsnapshot} -c ${config_file} weekly",
|
106 |
| - user => 'root', |
| 104 | + user => $server_user, |
107 | 105 | hour => ($backup_time_hour + 3) % 24,
|
108 | 106 | minute => $backup_time_minute,
|
109 | 107 | weekday => $backup_time_weekday
|
|
112 | 110 | ## monthly
|
113 | 111 | cron { "rsnapshot-${name}-monthly" :
|
114 | 112 | command => "${rsnapshot::server::cmd_rsnapshot} -c ${config_file} monthly",
|
115 |
| - user => 'root', |
| 113 | + user => $server_user, |
116 | 114 | hour => ($backup_time_hour + 6) % 24,
|
117 | 115 | minute => $backup_time_minute,
|
118 | 116 | monthday => $backup_time_dom
|
|
156 | 154 |
|
157 | 155 | # config file
|
158 | 156 | concat { $config_file :
|
159 |
| - owner => $::rsnapshot::server::user, |
160 |
| - group => $::rsnapshot::server::user, |
| 157 | + owner => $server_user, |
| 158 | + group => $server_user,, |
161 | 159 | mode => '0644',
|
162 | 160 | warn => true
|
163 | 161 | }
|
|
0 commit comments