Monthly task for audit database maintenance

You can share your Lua Scripts with everybody here.

Monthly task for audit database maintenance

Postby FTP » Tue Apr 20, 2021 1:22 am

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
FTP
Site Admin
 
1829
 
Tue Sep 29, 2009 6:09 am

Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 2 guests