mysqldump Cron job failing because of vi
Posted by: Odis
Posted on: 2008-03-27 07:35:00
Hello. I've done the following via shell and it worked successfully...but when doing it through cron I get errors. Does anyone know a work around for this? Thanks
cd /home/account
rm account.dump.sql
mysqldump -uuser -ppassword -h oldaccount.domain.com --opt oldaccount > account.dump.sql
vi account.dump.sql -c :g/oldaccount/s//newaccount/g -c :wq!
mysqldump -uuser -ppassword -h newaccount.domain.com --opt newaccount < account.dump.sql
when doing it via cron I get:
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
[m [m [0m [H [2J [24;1H"account.dump.sql" 1091L, 16457780C
"account.dump.sql" 1091L, 16457780C written
-- MySQL dump 10.10