Juan Concepcion

GAIA Backups

Discussion created by Juan Concepcion on Oct 12, 2017
Latest reply on May 9, 2018 by Kalyan Addenki

There exists an issue in GAIA presently where backups just continuously grow and cannot be setup to auto delete.  The result is that the /var/log/ directory becomes full and then causes all types of application issues.  The following will run every  2 months and auto clean any backups older than the specified number of days (30 days in example below).  The reason this method is used is because the normal cron scheduler will not accept the command through webui or cli - therefore this will use the native crontab capabilities of linux to assist in cleaning up older backups.


In Gaia Clish, create a root user without capability to login:


HostName> add user jobuser uid 0 homedir /home/jobuser
HotsName> save config


Note: Avoid giving the user a password and avoid giving the user any Gaia roles as they are not needed.


In Expert mode, create a cron job for this user:
[Expert@HostName]# crontab -u jobuser -e


(This creates and allows you to edit the file /var/spool/cron/jobuser).


 Syntax for Entry in crontab:




Day of Month


Day of week | Command





*                   | /usr/bin/find /var/log/ -mtime +30 -wholename “/var/log/CPbackup/backups/*.tgz" -delete



Save the file: shift+: then x!


This will clean up backups older than 30 days @ midnight on the specified day every other month (in this example on the 1st day every two months)