Rotating logs
Brought to you by:
orsoni
Hello,
First of all, thanks again for the very useful grsync software.
While searching for the grsync ini file yesterday, I stumbled on the logs that have been piling up since I am using grsync. There were more than two GB of logs in the hidden grsync folder on my Ubuntu installation.
Grsync being a GUI application, we should not expect users to look for hidden folders in order to see/consult older the logs.
Moreover, what is more important in my eyes, I would suggest to implement some kind of rotating logs in order to avoid the logs of grsync eating up a lot of space on the harddisk.
Thanks in advance for taking these suggestions into account.
Cheers,
Francesco
Hello,
Thanks for your suggestion.
I'm not sure it's a task which should be done by grsync itself. There are tools which are specifically designed for the task: most distributions have "logrotate" or other such tools.
Furthermore logs are off by default, only some more experienced users will enable them.
I don't think every program which creates logs should replicate the log rotating code, with the additional risk of every log following different naming and configuration rules. A lot of code duplication and incoherence.
Maybe the grsync package could drop a file somewhere, in order to make use of the standard tools offered by the distribution. The issue I see with this approach is that, as far as I know, those configuration files are system-wide; will they work on a user level?
Martjin could you chime in for the deb package and debian/ubuntu setup?
Thanks!
I added a little note to the readme file about log rotation, as suggested by Martijn.
Thanks for looking into it.
You have a good point by considering that it might not be the task of grsync to rotate the logs.
But I doubt that a note in the Readme can make a substantial difference. (I don't expect the average user installing software through a GUI from a repository to read the Readme.)
I hope that Martijn will find a solution for the debian package.
Have a nice day.
Francesco
Hi Piero,
I might have an idea: What do you think about adding a additional option in the Preferences of grsync that says:
"Append logs".
When that option is enabled, we would have the current behaviour; when it is disabled, it would overwrite the last log of the corresponding rsync command.
This way, when a user looks into the Preferences and enables the logging option, he sees that the logs will not grow indefinetly if he does not enable append logs. Moreover, I would suggest to leave Append logs off by default; but I am not sure about this, because it changes the current behaviour.
Since Grsync is running on different platforms, I thought that it might be good telling you about this idea as it is a platform independent solution to the problem.
In any case, thanks again for this useful software.
Cheers,
Francesco
Looks good to me, will look into it asap.
Many thanks for the suggestion(s)!
Thanks to you for being so responsive and forthcoming.
Could you please write a notice in this thread when you are done with the "Append" option? I might add the changes to my PPA in Ubuntu.
Cheers
patch committed!
Thanks Piero for the patch. I will look in January into it, when I will have more time.
Enjoy the holidays.
Hi,
I just uploaded an updated version of grsync to my PPA for trusty, vivid, wily and xenial:
https://launchpad.net/~frafu/+archive/ubuntu/ppa
It now also has the new "Overwrite logs" option; however, I did not take the updated translations of revision 146 of trunk into my PPA.
Cheers