K.S. Bhaskar via plug on 23 Aug 2019 08:01:06 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Shell syntax vs crontab syntax


Walt –

I don't have an answer to your question. But since you're a database power user (PostgreSQL as I recall), why not just feed it into a database which is designed to handle large volumes of data instead of futzing with maildirs?

Regards
– Bhaskar

On Fri, Aug 23, 2019 at 10:07 AM Walt Mankowski via plug <plug@lists.phillylinux.org> wrote:
I run fail2ban and it generates a lot of email. I decided to switch
from putting everything in one enormous maildir to monthly maildirs.
Rather than making a whole bunch (and then likely forgetting about it)
I figured I'd make a cron job that would add the next month's folder.

If I run this on the command line it works fine:

  maildirmake /tmp/fail2ban.`date --date='next month' '+%Y%m'`

But when I tried to use that same syntax in my crontab I got the message:

  /bin/sh: 1: Syntax error: EOF in backquote substitution

What ended up working was this:

  maildirmake /tmp/fail2ban.`date --date='next month' \+\%Y\%m`

I've run into situations like this in the past where the quoting rules
for the shell and crontab seem to be different. I've never found
anything that explains why it's different. Is it because I'm using
zsh?

Walt

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug