🛒 More SmartTasks
👍 Tested to be working with R81.20+
SmartTask to verify the security management's backup state.
Script code
Copy the code below into a new script of your SmartConsole script repository.
if [[ -e /var/log/CPbackup/backups/.last_backup_status ]];then echo '{"result":"success"}';if (((`date +%s`-`date -r /var/log/CPbackup/backups/.last_backup_status +%s 2>/dev/null`) > 2592000 ));then echo '{"result":"failure","message":"Last backup of '$(hostname)' too old"}';elif [[ -z `grep ucce /var/log/CPbackup/backups/.last_backup_status` ]];then echo '{"result":"failure","message":"Failure creating backups on '$(hostname)'"}';fi;else echo '{"result":"failure","message":"No backups configured on '$(hostname)'"}';fi
SmartTask
Create a new SmartTask in SmartConsole > Manage & Settings > SmartTasks and install policy to activate the new task.
Name |
Trigger |
Action |
Enabled |
Task_MgmtBackupCheck |
Before Publish |
Run Script |
✔️ |