Monthly task for audit database maintenance

You can share your Lua Scripts with everybody here.
Post Reply
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Monthly task for audit database maintenance

Post 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
Post Reply