문제

From the command line, I want to create an at job to run a mysql query. As you can imagine searching on google or here stackoverflow for "at" is difficult.

This works fine and the query runs like it ought to:

mysql -e 'MY QUERY;'

but if I do this:

at 17:30 mysql -e 'MY QUERY;'

At 5:30 I get a mail that tells me "UPDATE: command not found" and the query doesn't run. I set up a .my.cnf file already. Is there something else I'm forgetting?

도움이 되었습니까?

해결책

I believe you have a shell escape issue. The shell is likely eating the quotes. Try double quoting like so:

at 17:30 mysql -e "\"MY QUERY;\""
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top