{"id":963,"date":"2014-05-06T10:45:05","date_gmt":"2014-05-06T09:45:05","guid":{"rendered":"http:\/\/oprsteny.cz\/?p=963"},"modified":"2014-05-06T10:50:57","modified_gmt":"2014-05-06T09:50:57","slug":"lftp-backup-website-over-ftp","status":"publish","type":"post","link":"https:\/\/oprsteny.cz\/?p=963","title":{"rendered":"LFTP &#8211; Backup website over FTP"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"965\" data-permalink=\"https:\/\/oprsteny.cz\/?attachment_id=965\" data-orig-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/linux2.png\" data-orig-size=\"129,150\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"Linux\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/oprsteny.cz\/wp-content\/uploads\/linux2.png\" class=\"alignleft size-full wp-image-965\" src=\"http:\/\/oprsteny.cz\/wp-content\/uploads\/linux2.png\" alt=\"Linux\" width=\"129\" height=\"150\" \/>I was facing\u00a0task\u00a0how to schedule an automatic\u00a0backup\/mirror of a website which allows connecting over FTP. PHP command <em>exec <\/em>was forbidden by the provider so it was not possible to run OS commands. PHP script execution time was set to quite short time so it was neither possible to zip using PHP functions and send the whole backup file somewhere easily.<!--more--><\/p>\n<p>I was looking for another option how I can backup\/mirror the website and found a pretty tool called LFTP. It allows connectiong with\u00a0quite many\u00a0protocols, including FTP.<\/p>\n<p>So I tried and it worked \ud83d\ude42<\/p>\n<p>The command I have setup in my CRON is like the following:<\/p>\n<pre>lftp -u <em>username,password\u00a0<\/em>-e \"set ftp:ssl-allow no; mirror -c www\/ \/var\/www; quit\" ftp.mysite.com<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was facing\u00a0task\u00a0how to schedule an automatic\u00a0backup\/mirror of a website which allows connecting over FTP. PHP command exec was forbidden by the provider so it was not possible to run OS commands. PHP script execution time was set to quite &hellip; <a href=\"https:\/\/oprsteny.cz\/?p=963\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":"LFTP - Backup website over FTP","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},"jetpack_post_was_ever_published":false},"categories":[39,40,5],"tags":[281,280,282],"class_list":["post-963","post","type-post","status-publish","format-standard","hentry","category-infrastructure","category-networking","category-tools","tag-backup","tag-lftp","tag-mirror"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3nYbe-fx","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=963"}],"version-history":[{"count":2,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/963\/revisions"}],"predecessor-version":[{"id":966,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=\/wp\/v2\/posts\/963\/revisions\/966"}],"wp:attachment":[{"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oprsteny.cz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}