You are not logged in.
Pages: 1
When I install I chroot /target and put noatime in fstab because thesedays we all use SSD's right.
Install, hopefully apt-cdrom will get into the 21st century and do something simples about add usb.
When I boot I rm /var/log/boot.0, and rm /var/log/dmesg.
And I, cat ; > /var/log/kern.log, and cat ; > /var/log/syslog
I would like to compile a script using the && operator say,
but I don't think I can pass a time argument to cat and then subsequently Ctrl Z.
Alternative?
Offline
I just disabled the rsyslog service.
P.S. Just in case, this is not recommended with systemd.
Last edited by aluma (2024-02-15 17:40:11)
Offline
#!/bin/sh
rm /var/log/boot.0 &&
rm /var/log/dmesg &&
timeout 1 cat ; > /var/log/kern.log &&
timeout 1 cat ; > /var/log/syslog
Offline
Those timeout 1 cat sub commands serve no purpose apart from delaying execution (which is what timeout achives). Is that from some random web advice?
And why do you want to connect some sub commands? And in such obscure manner?
Your script effectively has three command lines:
rm /var/log/boot.0 && rm /var/log/dmesg && timeout 1 cat
> /var/log/kern.log && timeout 1 cat
> /var/log/syslog
Those are the portions up to the semi-colons, which sub-dvide them into those command lines whilst && joins sub commands such that the latter (the right-hand side sub command) is only executed if the former (the left-hand side sub command) succeeds.
I'd suggest you rather want something like this:
#!/bin/sh
rm -f /var/log/boot.0 /var/log/dmesg
> /var/log/kern.log
> /var/log/syslog
I.e. remove the first two files ignoring that they might alread be removed, and then reset the other two to empty contents.
Offline
because thesedays we all use SSD's right
No sir...but I'm just some guy who like things old-school...
Offline
^^^^^^
Same here.
ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 22 Million Views since 1998
My Massive Stroke
Help! (off-topic)
Offline
I am still on spinning rust . . . and at my age could very well have a lifetime supply in my stash . . .
Offline
I've used "touch" to create a empty file... Not too sure about the date and time stamp.
pic from 1993, new guitar day.
Offline
There is a logrotate command.
logrotate -f, --force Force file rotation
The log is needed during setup, if everything works, why not completely disable it?
And turn it on if necessary.
Offline
It's nice to be in the company of literate people!
But can someone explain why all this fuss with rm /var/log/boot.0 ?
Will we replace cron and logrotate?
And what does SSD have to do with it? Has the number of rewrites become smaller due to this?
But SSDs are actually good, especially for older laptops with weak processors.
Offline
Hello:
... replace cron and logrotate?
Don't think so.
I certainly won't, find them both to be quite useful.
... has the number of rewrites become smaller ...
Can't really say.
If it has, I think that it may probably be by a relatively insignificant amount.
That said, there's always fstrim running with cron.weekly.
And /var/log/trim.log to check and see that it is working properly.
No need to logrotate it.
Started 01/04/2021 and it is only 600 lines long / 30K.
Best,
A.
Offline
I came up with the idea to cat a semi-colon to blank the file, as I remember using wvdial whick needed a semi-colon for a blank password.
I am very grateful ralph.ronnquist for your attention to the monkey scripting, which I obtained surfing the web.
The above script which I posted works.
But it is rubbish, obscure, abstruse, incorrect.
As you inform us, the script fails if the files already removed.
As to reset empty content, if I, cat ; > file, it stays like that forever, until I Ctrl Z, if I, timeout 1 cat ; > file, after one second it stops, it works.
I need to re-read numerous times, and comprehend, and understand, your superlative help.
Removing those two files, and resetting the other two, is exactly what I seek.
I do not want an archive of boot.gz & dmesg.gz, and I want empty kern.log & syslog, so I may study just one boot to login, if you understand me.
Your help is most champion, I will study, and learn.
Hello GlennW, I create files with touch all the time, perhaps everyone should.
In a world where nothing lasts forever, as for preserving our artefects (that's Australian & British spelling, which is correct from the Latin, I am spelling it Australian as a mark of respect to ralph.ronnquist!) I think rust is the most reliable, I think that's what banks prioritise, although I think the tax office is the most reliable.
I piece of ink and paper full of ones and zeros would be best, I suppose a quality microfiche is marvellous, thesedays could easily be machine read. I know that a lot of images/artworks are copied to A3 prints and preserved in a container.
The FBI would give us words of wisdom, but it wouldn't be concise, better asking the LAPD, they'd give us a second to none answer.
P.s. Emailing an attachment to yourself is handy.
And microsd cards are not gripped when they 'click' into devices is good to know.
I only really have one pedantic pet hate, it's not an adapter, it's an ADAPTOR!
By the way, if you're an American in Balmoral in Scotland, it's NOT Balmorale!
Last edited by bilhook (2024-02-17 22:11:41)
Offline
Amen!
Now everything is clear, I didn’t realize it right away.
Offline
>filename is the quickest way to empty a file. Or cat /dev/null >filename if you want it to be more readable.
Offline
Pages: 1