<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">On Nov 17, 2020, at 12:03, Rick Moen <<a href="mailto:rick@linuxmafia.com" class="">rick@linuxmafia.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">A good basic way of copying files is</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""> rsync -avz olddirectory/ [host:]newdirectory/</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">If copying _within_ a host, you'd omit the 'z' because it's foolish to</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">gzip-compress source files into RAM and then immediately gunzip</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">decompress them to write them out again. The gzip compresion makes</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">sense only if it saves transmission time accross a network link.</span><br style="caret-color: rgb(0, 0, 0); font-family: LucidaGrande; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote></div><br class=""><div class="">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.</div><div class=""><br class=""></div><div class="">The first rsync, in the <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">currsite_plugs.each loop, is the local copy.</span></div><div class=""><br class=""></div><div class=""><div class="">wpsites.each_with_index do |currsite, i|</div><div class=""> currsite_plugdir = File.join(currsite + "wp-content", "plugins")</div><div class=""> currsite_plugs = Dir.entries(currsite_plugdir) rescue nil</div><div class=""> </div><div class=""> next if currsite_plugs.nil?</div><div class=""> </div><div class=""> puts "Updating plugins for #{currsite}"</div><div class=""> </div><div class=""> currsite_plugs.each do |currplug|</div><div class=""> next if currplug == ''</div><div class=""> next if currplug == '.'</div><div class=""> next if currplug == '..'</div><div class=""> next if currplug == "hello.php"</div><div class=""> next if currplug == "index.php"</div><div class=""> next if currplug == ".DS_Store"</div><div class=""> </div><div class=""> `rsync -av #{pluglist_dir}/#{currplug}/ #{currsite_plugdir}/#{currplug}/`</div><div class=""> end</div><div class=""> </div><div class=""> Dir.chdir(currsite)</div><div class=""><br class=""></div><div class=""> # add plugin updates to git repository</div><div class=""> </div><div class=""> `git add wp-content/plugins/`</div><div class=""> `git commit -m "Plugin update"`</div><div class=""> `git push -u origin master` unless quiet_mode</div><div class=""> `git push -u github master` unless quiet_mode</div><div class=""> </div><div class=""> # rysnc the sites up to the server</div><div class=""> </div><div class=""> puts "rsync -e ssh -av #{Dir.pwd}/wp-content/plugins/ #{remote_sites[i]}wp-content/plugins/"</div><div class=""> `rsync -e ssh -av #{Dir.pwd}/wp-content/plugins/ #{remote_sites[i]}wp-content/plugins/` unless quiet_mode</div><div class="">end</div></div><div class=""><br class=""></div></body></html>