开发者

Creating an "at" job from command line for a MYSQL query

开发者 https://www.devze.com 2023-01-22 03:10 出处:网络
From the command line, I want to create an at job to run a mysql query.As you can imagine search开发者_如何学编程ing on google or here stackoverflow for \"at\" is difficult.

From the command line, I want to create an at job to run a mysql query. As you can imagine search开发者_如何学编程ing 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;\""
0

精彩评论

暂无评论...
验证码 换一张
取 消