Skip to content

Commit

Permalink
Issue #14 : Add WordPress task to download locally remote uploaded fi…
Browse files Browse the repository at this point in the history
…les (with rsync)
  • Loading branch information
gido committed Sep 2, 2024
1 parent 1f1ba6b commit 9dfe70f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/capistrano/tasks/wordpress.rake
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,20 @@ namespace :wordpress do
end
end
end

namespace :files do
desc "Download WordPress uploads files (from remote to local)"
task :download do
run_locally do
on release_roles :app do |server|
ask(:answer, "Do you really want to download uploads files from the remote server to your local machine? Nothings will be deleted but files can be ovewrite. (y/N)");
if fetch(:answer) == 'y' then
remote_files_dir = "#{shared_path}/#{(fetch(:app_path))}/app/uploads/"
local_files_dir = "#{(fetch(:app_path))}/app/uploads/"
system("rsync --recursive --times --rsh=ssh --human-readable --progress #{server.user}@#{server.hostname}:#{remote_files_dir} #{local_files_dir}")
end
end
end
end
end
end

0 comments on commit 9dfe70f

Please sign in to comment.