MySQL INTO OUTFILE override existing file?

后端 未结 7 1619
抹茶落季
抹茶落季 2020-12-05 06:19

I\'ve written a big sql script that creates a CSV file. I want to call a cronjob every night to create a fresh CSV file and have it available on the website.

Say for

7条回答
  •  -上瘾入骨i
    2020-12-05 06:48

    Why not rm -f /home/sites/example.com/www/files/backup.csv in the script ran by cron?

    You can run this from inside mysql. Just escape to the shell with \! For example:

    Mysql> \! rm -f /home/sites/example.com/www/files/backup.csv

提交回复
热议问题