Crontab

From Anthony Pastor Wiki Notes - Verba volant, scripta manent
Revision as of 11:11, 11 May 2016 by Anthoanthop (talk | contribs) (Created page with "=Match pattern A OR Pattern B OR Pattern C ...= <syntaxhighlight lang="bash"> tcpdump -A host bob.net | egrep '\"site\":{\"id\":\"(386105|87347|166881|381105|316817)\"' </syn...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Match pattern A OR Pattern B OR Pattern C ...

tcpdump -A host bob.net | egrep '\"site\":{\"id\":\"(386105|87347|166881|381105|316817)\"'

Comment out a specific crontab job

Let's say we have many jobs in crontab and we'd like to comment out this one:

*/10 * * * * /usr/share/mapstats/mapstats
  • Locally:
 crontab -l | sed 's/.*\usr\/share\/mapstats\/mapstats/#&/' | crontab -
  • Remotely on multiple servers, example:
for i in 172.16.16.{1..50}; do ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $i "crontab -l | sed 's/.*\usr\/share\/mapstats\/mapstats/#&/' | crontab -" ; done