Page 1 of 1

Monthly task for audit database maintenance

Posted: Tue Apr 20, 2021 1:22 am
by FTP
If you have large FTP traffics, the audit database will increase very fast, then it will be very slow (or unable) to get Audit & Report, so you need a scripting task to move the audit db into a backup folder monthly.

Code: Select all

c_SetGlobalOptionInt(GOPTION_AUDIT_ENABLE_INT, 0)
c_DisconnectSQLITE()
os.rename(c_GetAppPath().."/Log/audit_db", "d:/audit_db_"..os.date("%Y_%m_%d",os.time()))
c_SetGlobalOptionInt(GOPTION_AUDIT_ENABLE_INT, 1)

You may add a monthly task and input the above script, and modify the string "d:/audit_db_" into your own path
Image