Progrider

Programming discussion

Search

Searches topics and replies. Every word has to appear in the post.

19 posts found.

PostPosted
General · post #17

Reviving to say I moved one of my boxes to timers after this thread and then moved it back when I realised I'd forgotten how to read the journal on a read-only rescue boot. journalctl -D /mnt/var/log/journal for next time.


by oldpc
Handoffs · post #2

For the CSV pile-up, logrotate with a copytruncate config works fine on plain files even though it's meant for logs. Or just date the filename in export.py and delete anything older than 30 days.


by Anonymous
Handoffs · post #1

For whoever picks this up (probably me in a month): - export.py reads readings.db and writes readings.csv, runs from systemd nightly - garage sensor reports every 15 min, porch every 5, the CSV has both - the --since flag works but isn't us…


by dan_r
General · post #16

On points perhaps. My timers are still running.


by dan_r
General · post #15

I'll take it. Thread closed, I win.


by sysv
General · post #14

OnFailure= pointing to a unit that sends a mail. You have to write that unit. I'll give you that one, cron wins on this.


by dan_r
General · post #13

Fine. One real point: cron mails me on failure and it's built in. What do you do with a timer?


by sysv
General · post #12

user timers need loginctl enable-linger or they stop when you log out. that one cost me a week of missing backups


by Anonymous
General · post #11

Cron's environment has caught me more than anything else on this list. PATH with nothing in it, wrong cwd. A service unit can have the same issue but at least you can test it with systemctl start and get the same environment as the real run…


by kettle
General · post #10

The log file can.


by sysv
General · post #9

For the record here's what the whole thing actually is: # backup.service [Service] Type=oneshot ExecStart=/usr/local/bin/backup.sh # backup.timer [Timer] OnCalendar=--* 02:15:00 Persistent=true RandomizedDelaySec=300 [Install] WantedBy=time…


by nils !PxNS1ZCy
General · post #8

Timers still need a service file, a timer file and a daemon-reload to do what one line did. I'm with sysv. Grudgingly, since I don't agree with him about anything else.


by vek
General · post #7

No. I found out about flock when four rsyncs were running at once.


by sysv
General · post #6

And you remember it every time? Honest question.


by dan_r
General · post #5

flock -n /tmp/x.lock cmd. Eleven characters plus a filename.


by sysv
General · post #4

The other one for me is overlap. A timer won't start the service again while it's still running. With cron a slow job stacks up unless you remember to wrap it in flock.


by oldpc
General · post #3

So install anacron.


by sysv
General · post #2

I had the same view until a sensor box was off for a night and missed its backup. Persistent=true runs the missed job at next boot. With cron you need anacron for that.


by dan_r
General · post #1

Every six months somebody tells me to move my jobs to timers. So: two files instead of one line, and a unit name I now have to think of, so that I can read the output through journalctl instead of a plain file. What exactly do I get? I've b…


by sysv
All times shown in UTC.