cronjob to remove gallery2 spam
Posted by: dalemarsden
Posted on: 2007-07-17 22:33:00
So, I'm a bigtime newb on cron, sql, etc. I'm getting a big load of spam on my gallery2. I found a nice sql query (http://gallery.menalto.com/node/55331) to remove all of this, and it works like a charm when I run it as a query in phpmyadmin.
But I want to automate this as a cronjob so I don't have to do it manually every few hours. I know the cronjob interface in the DH control panel, but I can't seem to get the command I'm supposed to put as the command. Here's what I've tried (with everything in ALLCAPS replaced as appropriate)
mysql -h HOST -u USER -p PASSWORD gallery2sql < /home/USER/misc/utilities/removespam.txt
The file is just a text file containing the sql query. But this doesn't work. Likewise, following the DH wiki crontab entry, I tried with /usr/bin/mysql instead of just mysql, but no dice.
Can anyone help, and tell me what's wrong?