632 reputation
1317
bio website bit.ly/GFscreener11
location stackoverflow.com@askmarcos.com
age
visits member for 2 years, 11 months
seen yesterday

Pioneers are the ones with arrows in their backs.

Investment Portfolio Software, Trade Automation

Designer of infinite compression algorithms, and other research projects


Nov
1
comment crontab and DST disagreement with different timezone
The idea is that for most of the year, a 1-hour wait will not be in effect. Only during the few weeks of a 5-hour difference (whether spring or fall), rather than the typical 6, will sleep 3600 be executed.
Nov
1
comment crontab and DST disagreement with different timezone
Minor update. en.wikipedia.org/wiki/Tz_database implies that since the DST rules for each zone are published into the TZ database, any up-to-date UNIX server should already have bundled knowledge of the wall clock time anywhere else in the world without having to consult over the network.
Nov
1
answered crontab and DST disagreement with different timezone
Nov
1
comment crontab and DST disagreement with different timezone
Thanks for the kluge; 9am was only a simplified example, in reality I have tasks sprinkled all over the clock and calendar. Developing on your idea, rather than stuffing my much longer, nastier crontab line into an if block, I could merely precede my commands with: ` [ $[$(date +%H) - $(TZ=":US/Eastern" date +%H)] == 5 ] && sleep 3600; w` where w is what I want to run at the right time
Nov
1
revised crontab and DST disagreement with different timezone
added 286 characters in body; edited title
Nov
1
comment crontab and DST disagreement with different timezone
No; I don't want all, and according to some other posts, TZ doesn't necessarily affect crontab (in Ubuntu which I use it doesn't), unlike for date eg. TZ=":US/Eastern" date +%Y%m%d
Nov
1
asked crontab and DST disagreement with different timezone
Sep
4
awarded  Popular Question
Jul
10
answered history list in bash always truncated to 5000 lines at new login
Jul
5
answered How do I background an SSH session?
Jun
19
comment shorten long lines in a log file
I think I see; what's needed is a variable-length regex between the 130 and 40 matchers. So this might be the final sed way: sed -i.bak -e 's/^\(.\{80\}\).\{130,\}.*\(.\{40\}\)$/\1 ... \2/' All those \ make it annoying to read, but I understand why they're necessary. The awk way is more human readable for someone not used to these regexes.
Jun
19
comment shorten long lines in a log file
I get your 1st example (though haven't tested if it still prints shorter lines unchanged). In your 2nd example, doesn't the middle search expression catch strings of exactly 130 length only (hence 250 char lines)?
Jun
18
comment shorten long lines in a log file
Also useful esp. with -i, as I may be looking to keep closer to only the first 1024 and last 1024 chars, which shouldn't modify most lines, only ridiculously long ones. Still the awk method lets me replace the middle with a " ... " easily in such cases.
Jun
18
comment shorten long lines in a log file
Minor detail, I was able to make do without the extra len variable altogether
Jun
18
comment shorten long lines in a log file
Nice and concise, thanks. (Too bad awk lacks a -i in-place file replace option like sed. I'll just awk ... file1 > file2 && mv -f file2 file1)
Jun
18
asked shorten long lines in a log file
May
10
comment fetchmail to log complete messages AND pass to mda
I considered that too, making a simple wrapper that logs before handing off/exec to the real MDA. The trouble is that mucks with the stdout of fetchmail, which sometimes I count on leaving unread partially or at all (the fetchmail side of the pipe sees where the seek pointer left off...)
May
9
comment Get “date” to understand a timestamp phrase of a different language
Reminder: I don't get to control the input format. But I may prepend or append eg. the current year before sending off the whole string to a universal, magic parser.
May
9
revised fetchmail to log complete messages AND pass to mda
explained better detail
May
9
comment fetchmail to log complete messages AND pass to mda
An alternative to fetchmail as a layer would be fine too