[conspire] FileZilla isn't a file manager (but you can use it as one) (was: FTP)

Deirdre Saoirse Moen deirdre at deirdre.net
Tue Nov 17 12:23:15 PST 2020


On Nov 17, 2020, at 12:03, Rick Moen <rick at linuxmafia.com> wrote:
> 
> A good basic way of copying files is
> 
>    rsync -avz olddirectory/ [host:]newdirectory/
> 
> If copying _within_ a host, you'd omit the 'z' because it's foolish to
> gzip-compress source files into RAM and then immediately gunzip
> decompress them to write them out again.  The gzip compresion makes
> sense only if it saves transmission time accross a network link.

I don’t think I excerpted a script I use for updating WordPress plugins. I keep a master plugin directly, then rsync plugin by plugin for each site so they’re updated. Then push to remote with rsync.

The first rsync, in the currsite_plugs.each loop, is the local copy.

wpsites.each_with_index do |currsite, i|
  currsite_plugdir = File.join(currsite + "wp-content", "plugins")
  currsite_plugs = Dir.entries(currsite_plugdir) rescue nil
  
  next if currsite_plugs.nil?
  
  puts "Updating plugins for #{currsite}"
  
  currsite_plugs.each do |currplug|
    next if currplug == ''
    next if currplug == '.'
    next if currplug == '..'
    next if currplug == "hello.php"
    next if currplug == "index.php"
    next if currplug == ".DS_Store"
    
    `rsync -av #{pluglist_dir}/#{currplug}/ #{currsite_plugdir}/#{currplug}/`
  end
  
  Dir.chdir(currsite)

  # add plugin updates to git repository
  
  `git add wp-content/plugins/`
  `git commit -m "Plugin update"`
  `git push -u origin master` unless quiet_mode
  `git push -u github master` unless quiet_mode
  
  # rysnc the sites up to the server
  
  puts "rsync -e ssh -av #{Dir.pwd}/wp-content/plugins/ #{remote_sites[i]}wp-content/plugins/"
  `rsync -e ssh -av #{Dir.pwd}/wp-content/plugins/ #{remote_sites[i]}wp-content/plugins/` unless quiet_mode
end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://linuxmafia.com/pipermail/conspire/attachments/20201117/983842a2/attachment.html>


More information about the conspire mailing list