diff --git a/modules/rhizomatica_base_system/files/etc/cron.d/rhizomatica b/modules/rhizomatica_base_system/files/etc/cron.d/rhizomatica index 66ad6bd..4b166a3 100644 --- a/modules/rhizomatica_base_system/files/etc/cron.d/rhizomatica +++ b/modules/rhizomatica_base_system/files/etc/cron.d/rhizomatica @@ -34,7 +34,11 @@ PYTHONPATH=$PYTHONPATH:/var/rhizomatica/rccn */5 * * * * root /var/rhizomatica/bin/monitor_rapi.sh > /dev/null 2>&1 #Billing -00 10 * * * root [[ $(date +'%d') -eq $(cal | awk '!/^$/{ print $NF }' | grep -v '^ ' | tail -1) ]] && /var/rhizomatica/bin/active_subscribers.sh + 0 10 * * * root [[ $(date +'%d') -eq $(cal | awk '!/^$/{ print $NF }' | grep -v '^ ' | tail -1) ]] && /var/rhizomatica/bin/active_subscribers.sh #Restart osmo-nitb every 6 hours -00 */6 * * * root /usr/bin/sv restart osmo-nitb 2&>1 /dev/null + 0 */6 * * * root /usr/bin/sv restart osmo-nitb 2&>1 /dev/null + +#PostgreSQL backup + 0 3 * * * postgres /home/rhizomatica/bin/pg_backup_rotated.sh + 0 4 * * * root /home/rhizomatica/bin/sqlite_backup_rotated.sh diff --git a/modules/rhizomatica_base_system/manifests/init.pp b/modules/rhizomatica_base_system/manifests/init.pp index 1d64c6a..2446efa 100644 --- a/modules/rhizomatica_base_system/manifests/init.pp +++ b/modules/rhizomatica_base_system/manifests/init.pp @@ -156,6 +156,22 @@ class rhizomatica_base_system { ensure => directory, } + file { '/var/rhizo_backups': + ensure => directory, + } + + file { '/var/rhizo_backups/postgresql': + ensure => directory, + owner => 'postgres', + group => 'postgres', + require => File['/var/rhizo_backups'], + } + + file { '/var/rhizo_backups/sqlite': + ensure => directory, + require => File['/var/rhizo_backups'], + } + package { 'git': ensure => present, }