4 ms·
Finance needed to do end-of-year stuff a couple of days past end-of-year. The system couldn't handle this, bad things would happen and data would change once en
by orf 9y ago
Finance needed to do end-of-year stuff a couple of days past end-of-year. The system couldn't handle this, bad things would happen and data would change once end-of-year passes.
Solution? A bash script that does:
while true:
set date to 4pm end-of-year
sleep 1
- halfjoking 9y agoI know this isn't reddit, but this needs a reaction gif when you're in the meeting and someone is explaining the solution... https://thumbs.gfycat.com/MisguidedNimbleAtlanticspadefish-size_restricted.gif https://thumbs.gfycat.com/MisguidedNimbleAtlanticspadefish-s...
- nailer 9y agoWhy the loop, vs setting the date once?
- orf 9y agoNTP would resync it, and obviously after X hours it would no longer be end of year even if you set the date in the past. It needed to be end of year day for 2 or 3 days.
- nailer 9y agoyeah I get that but `while(true)` seems excessive. Why not just do it once and disable NTP?
- orf 9y agobecause time moves forwards, and if you set it to 4pm then in 1.5 hours it will be 5.30pm, and the end-of-year stuff will kick in? Three lines of bash seemed simpler. It's a hack, yes, and there are better ways. But really who gives a damn.
- evgen 9y agoI would guess the system was probably running ntpd or some other time sync service that they were unwilling or unable to turn off.
- twic 9y agoGreat minds think alike: https://stackoverflow.com/a/6139477/116639 https://stackoverflow.com/a/6139477/116639