/var/log files

Posted:
in macOS edited January 2014
What are some of these files? There are some real huge files there! :eek: I heard these are supposed to be deleted at 2 am or somthing. Are these the log files safe to be deleted?

Comments

  • Reply 1 of 7
    thuh freakthuh freak Posts: 2,664member
    they are logs (duh?). they aren't deleted at 2am really. i'm pretty sure thats when new ones are made. the old ones are gzip'd up. i dont think old ones are ever really deleted, just added to a gz. mine dont take up too much space so i never messed with them, but i think deleting them would be ok.
  • Reply 2 of 7
    [quote]Originally posted by Spiffster:

    <strong>What are some of these files? There are some real huge files there! :eek: I heard these are supposed to be deleted at 2 am or somthing. Are these the log files safe to be deleted?</strong><hr></blockquote>



    You can delete these and it will affect nothing (except your ability to read them).
  • Reply 3 of 7
    It sounds as though you might be referring to the periodic maintenance scripts which UNIX based OS's usually perform in the wee hours of the morning. Whether these are the files the system cleans out when these scripts are triggered, I'm not sure. I'll leave that to someone more versed on UNIX.



    Back to the maintenance scripts, they can be triggered with an application like <a href="http://www.versiontracker.com/moreinfo.fcgi?id=10491&db=mac"; target="_blank">MacJanitor</a> or via the command line. Entering "man periodic" should give you an idea what it does.



    [ 01-17-2003: Message edited by: Brother_Maya ]</p>
  • Reply 4 of 7
    As mentioned above, it's perfectly safe to delete any/all of these.



    As far as I understand, each night (each at different times it seems) for some logs and each week for others, they are archived if need be into gzipped files. I don't know if all of them last indefinitely though.



    Generally they are only a few hundred kilobytes at best. Except for the webserver logs in /var/log/httpd/

    If you are running your webserver, these logs can easily be megs.
  • Reply 5 of 7
    [quote]Originally posted by thuh Freak:

    <strong>they are logs (duh?). they aren't deleted at 2am really. i'm pretty sure thats when new ones are made. the old ones are gzip'd up. i dont think old ones are ever really deleted, just added to a gz. mine dont take up too much space so i never messed with them, but i think deleting them would be ok.</strong><hr></blockquote>





    My question is HOW are they gzipped? does OS X use a scriptable app like Stuffit or does OS X have some native/built-in way of compressing/encoding files?
  • Reply 6 of 7
    [quote]Originally posted by dstranathan:

    <strong>

    My question is HOW are they gzipped? does OS X use a scriptable app like Stuffit or does OS X have some native/built-in way of compressing/encoding files?</strong><hr></blockquote>



    It probably uses the CLI gzip and unzip versions for this. These equivelents are found on most unix systems.



    Yes i did delete them and everything is fine.
  • Reply 7 of 7
    nevynnevyn Posts: 360member
    [quote]Originally posted by dstranathan:

    <strong>My question is HOW are they gzipped? does OS X use a scriptable app like Stuffit or does OS X have some native/built-in way of compressing/encoding files?</strong><hr></blockquote>





    This is completely non-destructive:



    Open Terminal.app and type the following line & hit return

    more /etc/periodic/*/*



    Hit the space bar to see the next screenful of stuff, there's plain English comments sprinkled around.



    All Unix, Unix-like, or Unix-based systems have _some_ way of 'scripting'.(I don't know of any whithout a LOT of ways of scripting either) There's a LOT of little bitty pieces that get stuck together to do larger tasks. One of them is GZIP - the basic command line version.



    It looks like the log files are packed up, and numbered. If there's enough, they are all rotated (log1 becomes log2... log9 is deleted) and the new log is named log1. So old logs do get deleted... eventually.



    man gzip

    man more

    man man



    Lots of things to explore by entering any of those into Terminal.app.
Sign In or Register to comment.