Jump to content

Search the Community

Showing results for tags 'cleanup'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • The latest WHMCS Release
    • V7.8 Release Discussion
  • The Latest from the WHMCS Team
    • News & Announcements
    • The WHMCS Blog
  • WHMCS.Community
    • Community Announcements
    • Introduce Yourself
  • Using WHMCS
    • Pre-Sales Questions
    • Admin & Configuration Questions
    • Installation, Upgrade, and Import Support
    • Using WHMCS
    • Troubleshooting Issues
    • Vendor Discussions
  • WHMCS Beta Program
  • WHMCS Showcase
    • Showcase Your Site
    • Share Your Best Practices & Tips
  • Developing & Extending WHMCS
    • Third Party Add-ons
    • Service Offers & Requests
    • Developer Corner
    • Building Modules
    • Share Ideas for WHMCS Modules
  • Community Competitions
    • Competitions
  • General Discussions
    • General Discussion
  • General Feedback & Assistance
    • WHMCS.Community Tips & Tricks
  • Third Party Developers's Topics
  • Turkish International Discussions's Topics
  • Russian International Discussions's Topics
  • Spanish International Discussions's Topics
  • Portuguese International Discussions's Topics
  • French International Discussions's Topics
  • Italian International Discussions's Topics
  • German International Discussions's Topics
  • WHMCS Brasil's Topics
  • WHMCS Brasil's Tópicos
  • ModulesGarden Club's Topics
  • Hungarian International Discussions's Segítség
  • ThemeMetro Club's Topics
  • WHMCS Services Club's Topics
  • SwiftModders Club's Topics
  • WHMCS Global Services Club's Topics

WHMCS Version

  • V7 Hotfixes
  • V7.1.x Hotfixes
  • V7.2.x Hotfixes
  • V7.3.x Hotfixes
  • V7.4.x Hotfixes
  • V7.5.x Hotfixes
  • V7.6.x Hotfixes
  • V7.7.x Hotfixes
  • V7.8.x Hotfixes

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Found 2 results

  1. First off thanks to the original thread for the inspiration for the first script. I was unable to reply there with my bash version of this. I also had another script so I figured id share all it here. #!/bin/bash ## Author: Michael Ramsey ## Objective clean 2 weeks prior to tbllog_register ## Please ensure that the database user used for this has both Select and Delete permissions for the whmcs database ## save as whmcs-register-clean.sh chmod it to 700 ## example cronjob ## 0 0 * * 0 /bin/bash /home/username/scripts/whmcs-register-clean.sh >/dev/null 2>&1 date2w=$(date --date='2 week ago' +"%Y-%m-%d") /usr/bin/mysql -h "localhost" -u "database_username" "-pPasswordhere" -e "DELETE FROM tbllog_register WHERE created_at < $date2w" database_name The second one is more for privacy based companies that want to prevent any client IP's from being unnecessarily saved and prevent DB growth for really large companies with active clients logins. We run privacy based logless VPN service and wanted to ensure there is no IP's ever saved of any of our clients. This included the client and support portal in addition to the VPN nodes and freeradius auth server. More information about this setup is in our blog post here > https://whattheserver.com/whmcs-client-last-login-ip-log-clearing-script/ #!/bin/bash ## Author: Michael Ramsey ## Objective clear last login IP and host from tblclients ## Please ensure that the database user used for this has both Select and Delete permissions for the whmcs database ## save as whmcs-client-clear-ip.sh chmod it to 700 ## example cronjob ## * * * * * /bin/bash /home/username/scripts/whmcs-client-clear-ip.sh >/dev/null 2>&1 #Clear clients last login IP address in table tblclients > ip,host /usr/bin/mysql -h "localhost" -u "database_username" "-pPasswordhere" -e "UPDATE tblclients SET ip = '', host = ''" database_name #Clear Order Ipaddress in table tblorders > ipaddress /usr/bin/mysql -h "localhost" -u "database_username" "-pPasswordhere" -e "UPDATE tblorders SET ipaddress = ''" database_name whmcs-register-clean.sh whmcs-client-clear-ip.sh
  2. I noticed in the database that the table tbllog_register has over 89,000 records in it, and tblactivitylog has over 12,000. I have Settings -> General Settings -> Limit Activity Log set to 1000, which apparently doesn't appear to be working for tblactivitylog, although the documentation does say, "Non client related entries will remain." I took a look at Utilities -> System -> System Cleanup, and none of the tools there appear to apply to the table tbllog_register. On that page, it shows only 2094 log entries in the Activity Log, so does that mean there are 10,000 non-client-related entries in the table? The Activity Log takes a long time to load even on my dedicated server, so it seems like a good idea to get control of those tables. What's the best way to keep the tables tblactivitylog and tbllog_register from getting huge?

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated