cap sync_db:to_local # Download and import DB to local
However, I'm getting this output/error:
Downloading Staging DB
(Backtrace restricted to imported tasks)
cap aborted!
NoMethodError: undefined method `execute' for main:Object
/.../lib/capistrano/tasks/sync_db.rb:10:in `block (2 levels) in <top (required)>'
Tasks: TOP => sync_db:to_local
(See full trace by running task with --trace)
the 'download!' command isn't working either ... what am I missing???
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/e4d093c2-4160-4b16-ab5d-89bc0b0b9de1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Capistranorb.com ?
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/fc782b4b-6c45-4a3b-ad7e-82599b6eb886%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/bd1c1b05-e0c0-43ff-8272-621ddfead4ec%40googlegroups.com.
desc "Export Stage DB to Local DB"
task :to_local do
#on roles(:all) do
run_locally do
puts 'Downloading Staging DB'
execute 'pwd'
date_path = Date.today.strftime("%Y/%m/%d")
download! "/var/mysql-backup/#{date_path}/oamm-wp-db_stage-00.sql.gz" "oamm-wp-db_stage-00.sql.gz"
end
end
➜ cap staging sync_db:to_local
Downloading Staging DB
INFO [4c3b8d6b] Running /usr/bin/env pwd as myuser@localhost
DEBUG [4c3b8d6b] Command: /usr/bin/env pwd
DEBUG [4c3b8d6b] /Users/myuser/Sites/mysite.dev
INFO [4c3b8d6b] Finished in 0.015 seconds with exit status 0 (successful).
(Backtrace restricted to imported tasks)
cap aborted!
Errno::ENOENT: No such file or directory - /var/mysql-backup/2015/05/06/oamm-wp-db_stage-00.sql.gzoamm-wp-db_stage-00.sql.gz
/Users/myuser/Sites/mysite.dev/lib/capistrano/tasks/sync_db.rb:14:in `block (3 levels) in <top (required)>'
/Users/myuser/Sites/mysite.dev/lib/capistrano/tasks/sync_db.rb:10:in `block (2 levels) in <top (required)>'
Tasks: TOP => sync_db:to_local
(See full trace by running task with --trace)
--
You received this message because you are subscribed to a topic in the Google Groups "Capistrano" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/capistrano/RMmt-ZHWwfc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/CAN_%2BVLW%2B__NokKz%3Dctg5vT_yDz8RYh-4ZH5bDdbkQqHK97Hncw%40mail.gmail.com.
Where do you see download! () documented?
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/CAHZp0Su%2BR%3DLG3Px2RSpXGxBXExo4R0X-FcSV2KMpctM3Tguguw%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/CAN_%2BVLWz0jPb-jk50khw-oy7H6VA3HMiBUuDk1GGTN8JFy3guQ%40mail.gmail.com.
Right, so it should run in an on('someserver') block. Its confusing because run_locally is a legacy API you can also do on(:local) but that's not what you want either.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/CAHZp0StwczQinNjQ-LQPW8H1L-B4dY349OasYRPm7wysRsaLAA%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUU92kJ%3DfTOBn8joqTxiEGRZnD5qEjwrWJ-v%2B1ykV2cuA%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/CAHZp0Sviw2T%3DT2BZ5ZJpnb-gjYtSENacO0R-80-E06TSJAb6Cg%40mail.gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/CAN_%2BVLW1ysvjoGyLABrhhP%3De4LQAT%3DEHGYXk0n3_U20RqXWADA%40mail.gmail.com.