A multitude of timeshift (and other) log files

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
axisofevil
Level 4
Level 4
Posts: 388
Joined: Mon Nov 14, 2011 12:22 pm

A multitude of timeshift (and other) log files

Post by axisofevil »

I upgraded to Cindy almost a month ago and got a directory /var/log/timeshift which (to-date) has gained 446 log files, each about 4KB, so not a massive storage problem (yet).

Unfortunately they are named according as YYYY-MM-DD_HH-MM-SS_xxxxx.log (where xxxxx is one of several possibilities).
So I can't use logrotate to remove the oldest versions - assuming that this is OK.
The naming convention appears to generate a new file every hour (but occasionally more often than this).
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: A multitude of timeshift log files

Post by catweazel »

axisofevil wrote: Fri Sep 28, 2018 8:44 am I upgraded to Cindy almost a month ago and got a directory /var/log/timeshift which (to-date) has gained 446 log files, each about 4KB, so not a massive storage problem (yet).
https://github.com/teejee2008/timeshift/issues/115
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
axisofevil
Level 4
Level 4
Posts: 388
Joined: Mon Nov 14, 2011 12:22 pm

Re: A multitude of timeshift log files

Post by axisofevil »

Thanks @catweazel !
Although the self-management of log files to "only" 500 files still seems excessive to me.
Useful for a developer, but if I needed to do a restore, it doesn't seem very useful.
Why not just write to a single log file like all other programs?

I'll wait and see what happens in a few days time.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: A multitude of timeshift log files

Post by catweazel »

axisofevil wrote: Fri Sep 28, 2018 9:46 am Why not just write to a single log file like all other programs?
lol - why are you asking me? I linked you to the developer.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
gm10

Re: A multitude of timeshift log files

Post by gm10 »

There's nothing interesting in those logs, anyway. If they bother you, just block them:

Code: Select all

sudo rm -r /var/log/timeshift;echo "logging disabled, delete me to enable"|sudo tee /var/log/timeshift
Alternatively, if, like me, you don't actually take hourly snapshots, get rid of that silly hourly cron job and make it e.g. weekly:

Code: Select all

F=/etc/cron.weekly/timeshift;sudo rm /etc/cron.d/timeshift-hourly;echo -e '#!/bin/sh'"\ntimeshift --check --scripted"|sudo tee $F;sudo chmod +x $F
Plenty ways to help yourself without even having to change timeshift itself. ;) Of course you can also just ignore the log files.
User avatar
axisofevil
Level 4
Level 4
Posts: 388
Joined: Mon Nov 14, 2011 12:22 pm

Re: A multitude of timeshift log files

Post by axisofevil »

Thanks!
User avatar
axisofevil
Level 4
Level 4
Posts: 388
Joined: Mon Nov 14, 2011 12:22 pm

Re: A multitude of timeshift log files

Post by axisofevil »

A brief resurrection of this thread on an unrelated matter...

Just discovered that I have 372 tiny log files in

Code: Select all

/root/.synaptic/log
these appear to be exactly one years worth of updates done via synaptic.
I shall leave these alone - but why create hundreds of useless files which then require a auto-removal process, controlled by date.

<rant>If something is worth logging, it should go to a single log file. </end rant>
Nuts2u
Level 3
Level 3
Posts: 129
Joined: Sun Nov 27, 2011 8:44 pm

Re: A multitude of timeshift (and other) log files

Post by Nuts2u »

This how I solve log file issues
tmpfs /var/log tmpfs defaults,noatime 0 0
in my fstab file. Every reboot clears it out. Simple and clean.
Silence is golden. Duct tape is silver. Welcome to Hell. Here's your copy of Windows.
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: A multitude of timeshift (and other) log files

Post by trytip »

Nuts2u wrote: Thu Oct 11, 2018 7:36 pm This how I solve log file issues
tmpfs /var/log tmpfs defaults,noatime 0 0
in my fstab file. Every reboot clears it out. Simple and clean.
your suggestion is good, but a new user will not know what to do with that info or where to put it. if you're going to offer it you'll need to explain how to do it.
but clearing the log every boot may have some unforeseen troubles. if you updated something and things break you may need to get back into some logs to see what was updated last. the simple solution is to just open /var/log/timeshift/ as root and just delete the logs. ok maybe a new user will not know what to do with logs and how to put them to good use anyway, but he/she may be asked to input some of those logs by members of this forum

so it's a double edged sword. personally i delete all my logs by hand and anyone can do this, but DO NOT delete the folders if someone should decide to start deleting log files
Image
User avatar
axisofevil
Level 4
Level 4
Posts: 388
Joined: Mon Nov 14, 2011 12:22 pm

Re: A multitude of timeshift log files

Post by axisofevil »

gm10 wrote: Fri Sep 28, 2018 10:13 am There's nothing interesting in those logs, anyway. If they bother you, just block them:

Code: Select all

sudo rm -r /var/log/timeshift;echo "logging disabled, delete me to enable"|sudo tee /var/log/timeshift
Actually, as @gm10 originally mentioned, replacing the /var/log/timeshift directory with a file called /var/log/timeshift stops timeshift's logging activities.
I've just discovered loads of tiny log files in /root/.synaptic/log (hidden log files) - but I shall leave these alone.

All my normal log messages are written to files in /var/log which are compressed and renamed in an automatic manner by logrotate on a daily/weekly/monthly frequency. I decide how many generations to keep - typically 3 or 4.

It's generally a bad idea to clear logs on every boot since it makes identification of recurrent problems difficult.
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: A multitude of timeshift log files

Post by trytip »

axisofevil wrote: Fri Oct 12, 2018 6:40 pm I've just discovered loads of tiny log files in /root/.synaptic/log (hidden log files) - but I shall leave these alone.
well this is just user logic. i always open synaptic > settings > preferences > files and under History files select Delete History files older than 30 days
i been doing this since ubuntu 11.10 . the first thing i do when trying out new things is check all the options that a program has. this way i can monitor synaptic logs in case i need to know some troublesome update and not keep extra files i really don't need
Image
gm10

Re: A multitude of timeshift log files

Post by gm10 »

axisofevil wrote: Fri Oct 12, 2018 6:40 pm It's generally a bad idea to clear logs on every boot since it makes identification of recurrent problems difficult.
Exactly. Logs are important, some more than others depending on your needs - e.g. I disable ufw firewall logging on my laptop because I know I will never review them- and having nothing after a reboot is a scary thought to me. But I guess the same argument can made for not keeping any logs - if you know you'll never review them and instead just timeshift out of every issue without care for the specifics I suppose.

As to the synaptic logs, they are superfluous because /var/log/apt/history.log contains the same info and, unlike the synaptic logs, gets properly logrotated. As trytip said, you can have synaptic clear them out itself though, I have it set to 0 days so it clears them out every time it runs. Still, no big deal just to ignore them, either.
Nuts2u
Level 3
Level 3
Posts: 129
Joined: Sun Nov 27, 2011 8:44 pm

Re: A multitude of timeshift (and other) log files

Post by Nuts2u »

Since LMDE3 is pretty solid, I don't install any software except from official repositories, and trusted sources, plus I'm install more and more apps via FlatPak (which is sand-boxed and doesn't mess with my core system) and finally if I manage to really bork my system somehow, I just restore a previous TimeShift snapshot, reboot and I'm done. The is about choice, so keeping log files and troubleshooting that way or using TimeShift to restore a snapshot either one is OK. The end user is the one that makes the choice, and either one in my book is valid. Me personally I follow the Kiss principle (Keep It Simple Stupid) because I do the stupidest things at times and I just want my borked system back up and running as quickly as possible. So I can get back on-line and into the LMDE3 forums and continue reading and learning from all the really smart people here.
Silence is golden. Duct tape is silver. Welcome to Hell. Here's your copy of Windows.
Locked

Return to “Software & Applications”