Filled Create Server Log clearer

Discussion in 'Archived: Plugin Requests' started by CoxBlox, Aug 24, 2013.

  1. Offline

    CoxBlox

    Hi, my server's log always gets filled up (400mb) roughly every week (several restarts, etc) and It's getting to be a chore to clear it. As a fan of automation, can anyone make a plugin that does this every week, after every restart, etc? The name for it could be Logcleaner or Cleanlog. I'd appreciate it, thanks!
     
  2. Offline

    FakieeGames

  3. Offline

    CoxBlox

    Yeah I did try it out, works on restart but no timed deletes unfortunately :/
    I like the timing of it the best i.e. delete every 7 days (24000ms, etc).
     
  4. Offline

    rguz10

    Using a dedicated server, VPS, or shared hosting?
     
  5. Offline

    CoxBlox

    I'm pretty sure shared hosting

    So... any of Bukkit's brilliant developers wanna take a stab at this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  6. Offline

    timtower Administrator Administrator Moderator

    As far as I know: The server log is in use when the server is running, we can't modify a file that is in use.
    However if you are able to change your startup script then I can clear your log every time the server stops
    btw: Don't bump withing 24 hours
     
  7. Offline

    CoxBlox

    sorry, I'm kind of new here; thanks for the info, I have my server restart twice a day, is there any way to tell it to clear log on start every 7 days?
     
  8. Offline

    timtower Administrator Administrator Moderator

    Possible, just need access to that .bat file
     
  9. Offline

    CoxBlox

    Ah, I boot from a shared hosting provider (hosthorde) so I don't really have access to a bat file :eek:
     
  10. Offline

    timtower Administrator Administrator Moderator

    Will see tomorrow if I can come up with something, maybe that I can still edit the server.log while the server is running. Don't know for sure though
     
  11. Offline

    CoxBlox

    Alright, it would be greatly appreciated!

    Actually now that I'm looking at it, if you could make the plugin also clear folder, that would be perfect: I found out today I had 200mb in residence backups, theres no way to disable that so, a nice weekly clear would help fix that :) thanks!
     
  12. Offline

    timtower Administrator Administrator Moderator

    CoxBlox Will make support for folders and files. Will not offer commands for this.
     
    CoxBlox likes this.
  13. Offline

    rguz10

    If clearing a log once a week is too much work, you probably shouldn't host IMO.
     
  14. Offline

    CoxBlox

    It's not so much work, but a simple plugin could fix something that costs 5 minutes of time each week, would save me 4 and a half hours each year; 4 and a half hours that I could be on my server. If it can save time, why not implement it?
     
    timtower likes this.
  15. Offline

    CoxBlox

    Are you still interested in developing this tim?
     
  16. Offline

    timtower Administrator Administrator Moderator

    Yes I am, will make it so it will clear the files every 6.75 days on startup.
     
    CoxBlox likes this.
  17. Offline

    CoxBlox

    :D Brilliant!
     
  18. Offline

    timtower Administrator Administrator Moderator

    https://www.dropbox.com/s/blnnbqe52n64qc1/FileDeleter.jar
    Time is in ms, check the config for it ;) Default is 6.75 day
    Files that are listed but aren't their won't cause errors!
    Please try this on a test server first, this is untested and could delete your server files!!!!!
    The main folder is the one where the server is located
     
  19. Offline

    CoxBlox

    Is there anyway to configure where the file is? i.e. root/plugins/worldedit ?
     
  20. Offline

    timtower Administrator Administrator Moderator

    There is a config list "deleted", there you put in the folders, so that would be: "plugins/worldedit"
     
  21. Offline

    CoxBlox

    Ah, do you change anything for root?
     
  22. Offline

    timtower Administrator Administrator Moderator

    This is already in the root folder, to delete the server.log just add the line server.log
     
  23. Offline

    CoxBlox

    I don't think the plugin works, set time to 6000 ms and the log was still there, good as new despite running for several minutes
     
  24. Offline

    timtower Administrator Administrator Moderator

    It only does something when it gets enabled
     
  25. Offline

    CoxBlox

    Ah has to be inabled in game Ill try that out
    Don't see any in-game commands, how do you activate it exactly?
     
  26. Offline

    timtower Administrator Administrator Moderator

    It will do its thing when it gets loaded, if you want it to run again just restart the server
     
  27. Offline

    CoxBlox

    Ah Tim, can this be done on a home server (running bukkit)?
     
  28. Offline

    timtower Administrator Administrator Moderator

    Edit your run.bat ( or how it is called )
    Code:
    :start
    [USER=90771833]Echo[/USER] off
    java -Xmx1024M -Xms1024M -jar craftbukkit.jar
    goto start
    This is mine, this will continually restart the server
     
  29. Offline

    CoxBlox

    I'm running this on my test server yet, despite restarting it manually every 2 minutes (roughly) it doesn't clear the log, and I doing anything wrong?
     
  30. Offline

    timtower Administrator Administrator Moderator

    Fixed some errors:
    • When I file is in use it will get removed when the server stops
    • Folders get removed, may leave an empty folder, don't worry, this will get removed at the next restart
    https://www.dropbox.com/s/blnnbqe52n64qc1/FileDeleter.jar
     

Share This Page