Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-29-2012, 04:42 AM   #1
G.S. Rashkovich
Junior Member
G.S. Rashkovich began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2012
Device: smartphone on MTK6235 chipset
How to rotate pycherry (Calibre) log files?

Hi all!
How should I rotate calibre_access_log.txt and calibre_error_log.txt under unixes?
Yeah, I know how to use newsyslog/logrotate... But Calibre access server doesn't use new logs after rotation until I stop/start it.
So the question is - should I (well, not me, but newsyslog or whatsaelse:-) send some signal to server? Which signal and to which PID?
Or should I use any other technique?

And, by the way, what to do under M$ Windows?

WBR,
G.S. Rashkovich

Last edited by G.S. Rashkovich; 04-29-2012 at 04:45 AM.
G.S. Rashkovich is offline   Reply With Quote
Old 04-29-2012, 04:48 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
echo > log_file

You cannot rotate log files in windows, Windows locks all open files.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-29-2012, 09:56 AM   #3
G.S. Rashkovich
Junior Member
G.S. Rashkovich began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2012
Device: smartphone on MTK6235 chipset
Once more, the same question...

Thanks for a quick answer.
But..."echo > log.txt" :-)...Was it a joke?

Once more, Calibre access server doesn't use new logs after rotation until I stop/start it. The same one is with "echo...", of course, plus delete old file.

I asked, how to ROTATE logs. In other words, how to switch to new log file, not how to truncate/delete it.

And the main part of question - how to do it WITHOUT SERVER RESTART.

I didn't mean just delete/truncate log with "echo", "rm", "truncate" etc. It's easy but out of use.
I need logs and just want to rotate them like any other server does. Maybe, with sending signal 15 or signal SIGUSR* or something like it.

Isit possible or should it be possible in future?
G.S. Rashkovich is offline   Reply With Quote
Old 04-29-2012, 10:14 AM   #4
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
As far as I know it is only possible with a server restart. However since that only takes seconds is it really a big issue?
itimpi is offline   Reply With Quote
Old 04-29-2012, 11:04 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Do I really need to SPELL it out?

cp log.txt archived-log.txt
echo > log.txt
kovidgoyal is offline   Reply With Quote
Advert
Old 05-04-2012, 04:12 AM   #6
G.S. Rashkovich
Junior Member
G.S. Rashkovich began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2012
Device: smartphone on MTK6235 chipset
Quote:
Originally Posted by itimpi View Post
As far as I know it is only possible with a server restart. However since that only takes seconds is it really a big issue?
Well, as for me - it's big enough, because ,logs rotated automatically at 3:00am or at <some> Mbytes, and all activity after it lost until I restart calibre manually.
G.S. Rashkovich is offline   Reply With Quote
Old 05-04-2012, 04:38 AM   #7
G.S. Rashkovich
Junior Member
G.S. Rashkovich began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2012
Device: smartphone on MTK6235 chipset
Quote:
Originally Posted by kovidgoyal View Post
Do I really need to SPELL it out?

cp log.txt archived-log.txt
echo > log.txt
Well, you may spell it or cast it or even sing it - but it doesn't work.

Sorry, I'm not a Python programmer, but is it so difficult to write to rotated log file? log() system call works good enough...
G.S. Rashkovich is offline   Reply With Quote
Old 05-04-2012, 04:46 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, it does. I dont need to be a python programmer to know that. All I need to know is that files on linux are opened by inode number. Which means that the first call to cp will copy the existing log, the second call to echo will truncate the file *without changing its inode number* which means that calibre will continue to write new entries to the truncated file.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Viewer: How to rotate the page? jschall Calibre 7 08-15-2015 08:59 PM
Calibre Log on Windows? RoninTech Calibre 5 07-06-2013 09:35 AM
Is there any way to let kindle only rotate PDF files? JackLiu Amazon Kindle 6 09-25-2010 08:08 PM
PRS-600 Log files disappearing after SD card unmount (buggy sync?), anyone seen this before? Xaphiosis Sony Reader Dev Corner 2 07-12-2010 07:49 PM


All times are GMT -4. The time now is 02:35 PM.


MobileRead.com is a privately owned, operated and funded community.