run disk usage task once a day

This commit is contained in:
Girish Ramakrishnan
2022-11-09 15:21:38 +01:00
parent 925b08c7a1
commit 3d6cdf8ff3
2 changed files with 9 additions and 1 deletions

View File

@@ -50,7 +50,8 @@ const gJobs = {
dockerVolumeCleaner: null,
dynamicDns: null,
schedulerSync: null,
appHealthMonitor: null
appHealthMonitor: null,
diskUsage: null
};
// cron format
@@ -95,6 +96,12 @@ async function startJobs() {
start: true
});
gJobs.diskUsage = new CronJob({
cronTime: `00 ${minute} 3 * * *`, // once a day
onTick: async () => await safe(cloudron.updateDiskUsage(), { debug }),
start: true
});
gJobs.diskSpaceChecker = new CronJob({
cronTime: '00 30 * * * *', // every 30 minutes. if you change this interval, change the notification messages with correct duration
onTick: async () => await safe(system.checkDiskSpace(), { debug }),