replace http with https

This commit is contained in:
2018-11-15 18:06:53 +08:00
parent 68c9a2260c
commit e46b67ade6
984 changed files with 321016 additions and 62 deletions

View File

@@ -0,0 +1,515 @@
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Lednerb">
<meta name="description" content="Bilberry Premium Theme for Hugo.">
<meta name="keywords" content="blog,personal,responsive,search,font awesome,pages,posts,multilingual,highlight.js,syntax highlighting,premium,shortcuts">
<meta name="generator" content="Hugo 0.50" />
<title> [筆記] Daily backup Websites and Offsite Backup using FTP 網頁備份 | My cool new Blog</title>
<meta name="description" content="[筆記] Daily backup Websites and Offsite Backup using FTP 網頁備份 - Bilberry Premium Theme for Hugo.">
<meta itemprop="name" content="[筆記] Daily backup Websites and Offsite Backup using FTP 網頁備份">
<meta itemprop="description" content="[筆記] Daily backup Websites and Offsite Backup using FTP 網頁備份 - Bilberry Premium Theme for Hugo.">
<meta property="og:title" content="[筆記] Daily backup Websites and Offsite Backup using FTP 網頁備份">
<meta property="og:description" content="[筆記] Daily backup Websites and Offsite Backup using FTP 網頁備份 - Bilberry Premium Theme for Hugo.">
<meta property="og:image" content="https://www.gravatar.com/avatar/88188b6cc451928eba90e8400bc68086?size=200">
<meta property="og:url" content="https://h.cowbay.org/article/daily-autobackup-websites-offsite-backup-using-ftp/">
<meta property="og:site_name" content="My cool new Blog">
<meta property="og:type" content="article">
<link rel="icon" type="image/png" href="https://h.cowbay.org/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="https://h.cowbay.org/favicon-16x16.png" sizes="16x16">
<link rel="stylesheet" href="https://h.cowbay.org/sass/combined.min.717098cb5503581e75f12e486a847ca410bf8367d4d8713f4c37affc868c5a1d.css">
</head>
<body class="bilberry-hugo-theme">
<nav>
<div class="container">
<ul class="topnav">
<li><a href="/page/about-bilberry/">About Bilberry</a></li>
<li><a href="https://github.com/Lednerb/bilberry-hugo-theme" target="_blank">Github</a></li>
</ul>
<div id="search-box" class="search">
<i class="fa fa-search"></i>
<input id="search" type="text" placeholder="Search ...">
</div>
</div>
</nav>
<header>
<div class="container">
<div class="logo">
<a href="/" class="logo">
<img src="https://www.gravatar.com/avatar/88188b6cc451928eba90e8400bc68086?d=mm&size=200" alt="">
<span class="overlay"><i class="fa fa-home"></i></span>
</a>
</div>
<div class="titles">
<h3 class="title"><a href="/">My cool new Blog</a></h3>
<span class="subtitle">Hello World! This is the most epic subtitle ever.</span>
</div>
<div class="languages">
<a href="/en" class="active">en</a>
<a href="/de">de</a>
</div>
<div class="toggler">
<i class="fa fa-bars" aria-hidden="true"></i>
</div>
</div>
</header>
<div class="main container">
<div class="article-wrapper u-cf single">
<a class="bubble" href="/article/daily-autobackup-websites-offsite-backup-using-ftp/">
<i class="fa fa-fw fa-pencil"></i>
</a>
<article class="default article">
<div class="content">
<h3><a href="/article/daily-autobackup-websites-offsite-backup-using-ftp/">[筆記] Daily backup Websites and Offsite Backup using FTP 網頁備份</a></h3>
<div class="meta">
<span class="date moment">2016-04-14</span>
<span class="categories">
<a href="/categories/%E5%B7%A5%E4%BD%9C%E7%AD%86%E8%A8%98">工作筆記</a>
</span>
</div>
<h2 id="daily-backup-websites-and-offsite-backup-using-ftp-網頁備份"><strong> Daily backup Websites and Offsite Backup using FTP 網頁備份</strong></h2>
<p>&nbsp;</p>
<p>1.多個資料庫一起備份 (事實上應該說備份MySQL Server內的所有資料庫) backup multiple databases , in facts , all databases will be dump and backup</p>
<p>2.每一天都是完整備份,所以空間使用量請自行斟酌 in my case , there`s a little more than 500MB per day , that means 180GB per year</p>
<p>3.備份完的資料透過FTP 外推到其他空間 backup files will be push to another sites using FTP</p>
<p>4.變數請自行替換成符合個人的環境 please consider to change the variables in the script</p>
<p>&nbsp;
&gt; #!/bin/bash
&gt;
&gt;
&gt; ############### Infos - Edit them accordingly  ########################
&gt;
&gt;
&gt; DATE=<code>date +%Y-%m-%d</code>
&gt;
&gt;
&gt; DATECODE=<code>date +%Y%m%d</code>
&gt;
&gt; LOCAL_BACKUP_DIR=&ldquo;/backups&rdquo;
&gt;
&gt; #DB_NAME1=&ldquo;DB1&rdquo;
&gt;
&gt; #DB_NAME2=&ldquo;DB2&rdquo;
&gt;
&gt; #DB_NAME3=&ldquo;DB3&rdquo;
&gt;
&gt; #DB_NAME4=&ldquo;DB4&rdquo;
&gt;
&gt; DB_USER=&ldquo;DBadmin&rdquo;
&gt;
&gt; DB_PASSWORD=&ldquo;DBadminpassword&rdquo;
&gt;
&gt;
&gt; FTP_SERVER=&ldquo;ftp.abc.com&rdquo;
&gt;
&gt; FTP_USERNAME=&ldquo;ftpuser&rdquo;
&gt;
&gt; FTP_PASSWORD=&ldquo;ftpuserpassword&rdquo;
&gt;
&gt; FTP_UPLOAD_DIR=&ldquo;/website_backup&rdquo;
&gt;
&gt;
&gt; LOG_FILE=/backups/backup-DATE.log
&gt;
&gt;
&gt; ############### Local Backup  ########################
&gt;
&gt; #<del>mysqldump -u $DB_USER -p$DB_PASSWORD &ndash;databases $DB_NAME1 $DB_NAME2 $DB_NAME3 $DB_NAME4 |gzip &gt; $LOCAL_BACKUP<em>DIR/$DATE-DB.sql.gz</del>
&gt;
&gt; #<del>mysql -uDBadmin -pDBadminpassword -e &lsquo;show databases&rsquo; | while read dbname; do mysqldump -uroot -pu6hk4  &ldquo;$dbname&rdquo; &gt; &ldquo;$dbname&rdquo;</em>$datecode.sql; done</del>
&gt;
&gt; mysql -uroot -pDBadmin -e &lsquo;show databases&rsquo;|grep -v Databas|grep -v information | while read dbname; do mysqldump -uDBadmin -pDBadminpassword  &ldquo;$dbname&rdquo; &gt; /backups/&ldquo;$dbname&rdquo;<em>$DATECODE.sql; done
&gt;
&gt; ls /backups/*.sql|while read dbname;do gzip -9 &ldquo;$dbname&rdquo;;done
&gt;
&gt; #############################################
&gt;
&gt; #網頁原始程式備份 ##
&gt;
&gt; #############################################
&gt;
&gt;
&gt; ls -l /var/www/html |egrep  &ldquo;^d&rdquo;|awk -F &ldquo; &rdquo; &lsquo;{print $9}&rsquo;|while read sitename;do tar czvf  /backups/&ldquo;$sitename&rdquo;</em>$DATECODE.tgz /var/www/html/$sitename;done
&gt;
&gt; #mysqldump -u $DB_USER  -p$DB_PASSWORD $DB_NAME | gzip  &gt; $LOCAL_BACKUP_DIR/$DATE-$DB_NAME.sql.gz
&gt;
&gt;
&gt; ############### UPLOAD to FTP Server  ################
&gt;
&gt;
&gt; ftp -nv $FTP_SERVER &lt;&lt; EndFTP
&gt;
&gt; user &ldquo;$FTP_USERNAME&rdquo; &ldquo;$FTP_PASSWORD&rdquo;
&gt;
&gt; binary
&gt;
&gt; cd $FTP_UPLOAD_DIR
&gt;
&gt; lcd $LOCAL_BACKUP_DIR
&gt;
&gt; prom
&gt;
&gt; mput *.sql.gz
&gt;
&gt; mput *.tgz
&gt;
&gt; bye
&gt;
&gt; EndFTP
&gt;
&gt;
&gt; ############### Check and save log, also send an email  ################
&gt;
&gt;
&gt; if test $? = 0
&gt;
&gt; then
&gt;
&gt; echo &ldquo;Database Successfully Uploaded to the Ftp Server!&rdquo;
&gt;
&gt; echo -e &ldquo;Database Successfully created and uploaded to the FTP Server!&rdquo; | mail -s &ldquo;Backup from $DATE&rdquo; user@abc.com
&gt;
&gt;
&gt; else
&gt;
&gt; echo &ldquo;Error in database Upload to Ftp Server&rdquo; &gt; $LOG_FILE
&gt;
&gt; fi
&nbsp;</p>
<p>&nbsp;</p>
</div>
<div class="footer no-tags">
</div>
</article>
</div>
<div id="disqus_thread"></div>
<script type="application/javascript">
var disqus_config = function () {
};
(function() {
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
return;
}
var d = document, s = d.createElement('script'); s.async = true;
s.src = '//' + "bilberry-hugo-theme" + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
<footer>
<div class="container">
<div class="recent-posts">
<strong>Latest posts</strong>
<ul>
<li>
<a href="/article/google-550-5-7-1-sloution/">寄信給google被退信 錯誤 550-5.7.1的解法</a>
</li>
<li>
<a href="/article/netdata-linux-system-performance-monitor-dashboard/">Netdata Linux System Performance Monitor Dashboard</a>
</li>
<li>
<a href="/article/linux-performance-monitor-dashboard-netdata-md/">Linux 底下極其詳細的System performace Monitor Dashboard - Netdata</a>
</li>
<li>
<a href="/article/syntax-test/">Syntax Test</a>
</li>
<li>
<a href="/article/psql-create-role-and-assign-priviledges/">psql create role and assign priviledges</a>
</li>
<li>
<a href="/article/study-url/">Study URL</a>
</li>
<li>
<a href="/article/rsync-time-backup/">[筆記] Linux 底下好用的備份工具 rsync-time-backup</a>
</li>
</ul>
</div>
<div class="categories">
<a href="/categories/"><strong>Categories</strong></a>
<ul>
<li>
<a href="/categories/%E6%9C%AA%E5%88%86%E9%A1%9E">未分類 (86)</a>
</li>
<li>
<a href="/categories/%E5%B7%A5%E4%BD%9C%E7%AD%86%E8%A8%98">工作筆記 (68)</a>
</li>
<li>
<a href="/categories/%E5%85%B6%E4%BB%96">其他 (46)</a>
</li>
<li>
<a href="/categories/%E7%AD%86%E8%A8%98">筆記 (30)</a>
</li>
<li>
<a href="/categories/%E5%89%AA%E5%A0%B1">剪報 (18)</a>
</li>
<li>
<a href="/categories/starting">Starting (5)</a>
</li>
<li>
<a href="/categories/blog">Blog (4)</a>
</li>
</ul>
</div>
<div class="right">
<div class="external-profiles">
<strong>Social media</strong>
<a href="https://twitter.com/TheRealLednerb" target="_blank"><i class="fa fa-twitter-adblock-proof"></i></a>
<a href="https://github.com/Lednerb" target="_blank"><i class="fa fa-github"></i></a>
</div>
<div class="languages">
<strong>Other languages</strong>
<a href="/en" class="active">en</a>
<a href="/de">de</a>
</div>
</div>
</div>
</footer>
<div class="credits">
<div class="container">
<div class="copyright">
<a href="https://github.com/Lednerb" target="_blank">
&copy;
2017
by Lednerb
</a>
</div>
<div class="author">
<a href="https://github.com/Lednerb/bilberry-hugo-theme" target="_blank">Bilberry Hugo Theme</a>
</div>
</div>
</div>
<script type="text/javascript" src="https://h.cowbay.org/js/externalDependencies.39c47e10e241eae2947b3fe21809c572.js" integrity="md5-OcR&#43;EOJB6uKUez/iGAnFcg=="></script>
<script type="text/javascript" src="https://h.cowbay.org/js/theme.ff50ae6dc1bfc220b23bf69dbb41b54e.js" integrity="md5-/1CubcG/wiCyO/adu0G1Tg=="></script>
<script>
$(".moment").each(function() {
$(this).text(
moment( $(this).text() )
.locale( "en" )
.format('LL')
);
});
$(".footnote-return sup").html("");
</script>
<script>
var client = algoliasearch("Y2C4RWMPXW", "50ea7f8c41c0ad233926e0be2b769ed1");
var index = client.initIndex("default-content");
$('#search').autocomplete({ hint: false, autoselect: true, debug: false },
[
{
source: $.fn.autocomplete.sources.hits(index, { hitsPerPage: 5, filters: 'language: en' }),
displayKey: function(suggestion) {
return suggestion.title || suggestion.author
},
templates: {
suggestion: function(suggestion) {
return "<span class='entry " + suggestion.type + "'>"
+ "<span class='title'>" + suggestion.title + "</span>"
+ "<span class='fa fa-fw " + suggestion.iconClass + "'></span>"
+ "</span>"
;
},
empty: function() {
return "<span class='empty'>Nothing found.</span>"
},
footer: function() {
return '<div class="branding">Powered by <img src="https:\/\/h.cowbay.org\/dist\/algolia-logo-light.svg" /></div>'
}
},
}
])
.on('autocomplete:selected', function(event, suggestion, dataset) {
window.location = (suggestion.url);
})
.keypress(function (event, suggestion) {
if (event.which == 13) {
window.location = (suggestion.url);
}
});
</script>
</body>
</html>