Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • could you elaborate a bit how to a. add it in cron b. what the different sed flags have you shared. The command is cryptic to understand, please elaborate. Commented Sep 8, 2016 at 7:09
  • @shirish crontab -e Refer here for info on the syntax. The first sed replaces any spaces with commas (to get a CSV format). The second sed prepends each line with the date and time (and comma, see edit). Commented Sep 8, 2016 at 8:05
  • I get a bad minute error while trying the above - ps --no-headers -eo "uname fname %cpu %mem" | sed -e 's/ \+/,/g' | sed "s/^/$(date --iso-8601='minutes'),/g" >> /home/shirish/ps.csv # from unix.stackexchange.com/questions/308269/… Commented Sep 8, 2016 at 18:56
  • the error it shows is "/tmp/crontab.lKLK8b/crontab":22: bad minute errors in crontab file, can't install. Commented Sep 8, 2016 at 18:59
  • @shirish Can you post the exact line you added in crontab? Commented Sep 8, 2016 at 20:06