I’m having an issue trying to load a series of sql files through our capistrano recipe for our testing environment.
Here’s what I came up to :
desc "Empty database and play sql scripts for fresh db structure"
task :mysqlrestore, :roles => :app do
run "find #{current_release}/migration/ -name '*.sql' -print0 | xargs -0 -I file mysql -hlocalhost -u#{db_username} -p#{db_password} #{db_database} < file"
My capistrano console outputs a :
failed: “sh -c ‘find /home/toolbox/www/staging/releases/20120119111819/migration/ -name ‘\”*.sql’\” -print0 | xargs -0 -I file mysql -hlocalhost -uuser -ppassword DBNAME < file'” on staging.env.com
Where could I be wrong ?
I was able to execute your command from bash just by removing your single quotes from your run command.
i.e.