{"id":1491,"date":"2015-10-27T10:08:24","date_gmt":"2015-10-27T16:08:24","guid":{"rendered":"http:\/\/blografia.net\/vicm3\/?p=1491"},"modified":"2015-11-02T14:13:32","modified_gmt":"2015-11-02T20:13:32","slug":"wp-cli","status":"publish","type":"post","link":"https:\/\/blografia.net\/vicm3\/2015\/10\/wp-cli\/","title":{"rendered":"Wp-cli"},"content":{"rendered":"<p>Well Dreamhost sometime ago installed wp-cli [1] on their machines think of it like drush [2] and it&#8217;s really fast and nice, managing wp via CLI is way easier and clean, yes I&#8217;m aware that for sometime now also there is WP multisite and other improvements but as I like to maintain my own blog and some of friends and don&#8217;t <del>like to move<\/del> have time to dig out on multi site kind of, I did some cheating installing and copying files on every release until WP added auto update, but themes and plugins still are a problem, but when wp-cli was announced as stock install on DH I implemented this little script, now I maintain like 9 blogs, but it had my life easier, of course could do better, but this one to update my blogs is fast useful and run via cron so also is automatic.<\/p>\n<pre>#!\/bin\/bash\r\n#find worpress install\r\nwpi=\"$(find -name \"wp-config.php\" | cut -d'\/' -f3)\"\r\npath=\/path\/to\/your\/wpinstall\r\n\r\nfor i in ${wpi}\r\ndo\r\necho \"$path\/$i\/\"\r\nwp --path=$path\/$i core update\r\nwp --path=$path\/$i theme update --all\r\nwp --path=$path\/$i plugin update --all\r\n\r\ndone\r\n<\/pre>\n<p>As you can see this is a hack to update WP, themes, and plugins automatically, from a crontab that runs weekly. In the current form as is a quick fix, I need $path to install and also from $wpi I get which directories actually are WordPress as also had static archives of older blogs and other stuff, most probably can work both paths from only one var, but as it works for me, \u00abif ain&#8217;t broke, you don&#8217;t fix it\u00bb.<\/p>\n<p>[1]\u00a0http:\/\/wp-cli.org\/<br \/>\n[2]\u00a0http:\/\/www.drush.org\/en\/master\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well Dreamhost sometime ago installed wp-cli [1] on their machines think of it like drush [2] and it&#8217;s really fast and nice, managing wp via CLI is way easier and clean, yes I&#8217;m aware that for sometime now also there &hellip; <a href=\"https:\/\/blografia.net\/vicm3\/2015\/10\/wp-cli\/\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3,10,8,7],"tags":[547,546,249,505,504,61,545],"class_list":["post-1491","post","type-post","status-publish","format-standard","hentry","category-general","category-planetalinux","category-sysadmin","category-web","tag-auto","tag-cron","tag-diy","tag-sysadmin","tag-web","tag-wordpress","tag-wpc-li"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":975,"url":"https:\/\/blografia.net\/vicm3\/2012\/11\/webalizer-for-no-system-logs\/","url_meta":{"origin":1491,"position":0},"title":"Webalizer for no system logs","author":"vicm3","date":"5 noviembre, 2012","format":false,"excerpt":"Last month we requested a report from IT department, we expected nice charts, averages, max request, minimum, peak hours \/ days \/ weeks, month. What we got was a nice 65MB RTF file with a copy & paste of Apache access.log. As professors my colleagues where outraged to say the\u2026","rel":"","context":"En \u00abGeneral\u00bb","block_context":{"text":"General","link":"https:\/\/blografia.net\/vicm3\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1691,"url":"https:\/\/blografia.net\/vicm3\/2016\/11\/automagic-moodle-update\/","url_meta":{"origin":1491,"position":1},"title":"Automagic Moodle update","author":"vicm3","date":"14 noviembre, 2016","format":false,"excerpt":"Well its monday so semi auto magic roll of patches on CentOS via yum-cron on Debian broken for some dumb and strong firewall rules but applied via unattended updates now done through a ssh tunnel using tsocks, been thinking on create a permanent tunnel or one based on apt.conf and\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1104,"url":"https:\/\/blografia.net\/vicm3\/2013\/09\/svn-and-its-new-sqlite-format-again\/","url_meta":{"origin":1491,"position":2},"title":"SVN and its new sqlite format again","author":"vicm3","date":"10 septiembre, 2013","format":false,"excerpt":"I been a user of svn for a quite long time now, and had to work around certain \"features\", like berkeley.db locking on multiuser home directories, the migration to FS logs, and problems working with multi platform environments, most of it its documented on this blog. Yeah, git is sexy,\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1091,"url":"https:\/\/blografia.net\/vicm3\/2013\/08\/scratch-on-debian-continued\/","url_meta":{"origin":1491,"position":3},"title":"Scratch on Debian continued","author":"vicm3","date":"8 agosto, 2013","format":false,"excerpt":"Not really following this, but today as I updated a older machine where i have tweaked an Ubuntu Scratch package to be able to install it on Squeeze, I just noticed the following: $ apt-cache show scratch Package: scratch Version: 1.4.0.6~dfsg1-4 Installed-Size: 45660 Maintainer: Miriam Ruiz <miriam@debian.org> Architecture: all Depends:\u2026","rel":"","context":"En \u00abEducaci\u00f3n\u00bb","block_context":{"text":"Educaci\u00f3n","link":"https:\/\/blografia.net\/vicm3\/category\/educacion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":973,"url":"https:\/\/blografia.net\/vicm3\/2012\/11\/seatools-boot-from-usb-stick\/","url_meta":{"origin":1491,"position":4},"title":"How To Create Bootable USB Disk For Seagate SeaTools","author":"vicm3","date":"3 noviembre, 2012","format":false,"excerpt":"This entry originally was named \"Seatools boot from usb stick\", but as I searched on google, results with bad to worse methods to create bootable usb sticks are up in place, so I changed the name in hope that gets more visibility on the net. Recently I need to use\u2026","rel":"","context":"En \u00abGeneral\u00bb","block_context":{"text":"General","link":"https:\/\/blografia.net\/vicm3\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":845,"url":"https:\/\/blografia.net\/vicm3\/2012\/02\/scratch-on-debian\/","url_meta":{"origin":1491,"position":5},"title":"Scratch on Debian","author":"vicm3","date":"7 febrero, 2012","format":false,"excerpt":"For some unknown reason, at least for me (license most likely) there is no Scratch package in Debian as long I remember the problem could be that the name and the mascot are trademarks (same problem that with Firefox \/ Iceweasel), any case there is a .deb package for Ubuntu,\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts\/1491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/comments?post=1491"}],"version-history":[{"count":0,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts\/1491\/revisions"}],"wp:attachment":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/media?parent=1491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/categories?post=1491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/tags?post=1491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}