|
|
<!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> [筆記] Linux 底下好用的備份工具 rsync-time-backup | My cool new Blog</title>
|
|
|
<meta name="description" content="[筆記] Linux 底下好用的備份工具 rsync-time-backup - Bilberry Premium Theme for Hugo.">
|
|
|
<meta itemprop="name" content="[筆記] Linux 底下好用的備份工具 rsync-time-backup">
|
|
|
<meta itemprop="description" content="[筆記] Linux 底下好用的備份工具 rsync-time-backup - Bilberry Premium Theme for Hugo.">
|
|
|
<meta property="og:title" content="[筆記] Linux 底下好用的備份工具 rsync-time-backup">
|
|
|
<meta property="og:description" content="[筆記] Linux 底下好用的備份工具 rsync-time-backup - 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/rsync-time-backup/">
|
|
|
<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/rsync-time-backup/">
|
|
|
<i class="fa fa-fw fa-pencil"></i>
|
|
|
</a>
|
|
|
|
|
|
<article class="default article">
|
|
|
|
|
|
|
|
|
<div class="content">
|
|
|
<h3><a href="/article/rsync-time-backup/">[筆記] Linux 底下好用的備份工具 rsync-time-backup</a></h3>
|
|
|
<div class="meta">
|
|
|
|
|
|
|
|
|
<span class="date moment">2018-04-10</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span class="categories">
|
|
|
|
|
|
<a href="/categories/%E7%AD%86%E8%A8%98">筆記</a>
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p>很好用的工具,利用rsync 去作到類似MAC上的 time machine的功能
|
|
|
備份後的目錄大概會是這樣子</p>
|
|
|
|
|
|
<pre><code>drwxr-xr-x 1 mini sudo 3100 Apr 9 16:14 2018-04-10-160719
|
|
|
drwxr-xr-x 1 mini sudo 3100 Apr 9 16:14 2018-04-10-160224
|
|
|
drwxr-xr-x 1 mini sudo 3100 Apr 9 16:14 2018-04-10-160054
|
|
|
drwxr-xr-x 1 mini sudo 3100 Apr 9 16:14 2018-04-10-155836
|
|
|
drwxr-xr-x 1 mini sudo 3100 Apr 9 16:14 2018-04-10-155826
|
|
|
-rw-r--r-- 1 mini sudo 0 Apr 10 15:58 backup.marker
|
|
|
drwxr-xr-x 1 mini sudo 472 Apr 10 16:07 ..
|
|
|
lrwxrwxrwx 1 mini sudo 17 Apr 10 16:07 latest -> 2018-04-10-160719
|
|
|
drwxr-xr-x 1 mini sudo 208 Apr 10 16:07 .
|
|
|
2018-04-10 16:12:37 [mini@h9 ~]$
|
|
|
</code></pre>
|
|
|
|
|
|
<p>前面幾個目錄都可以進去看檔案內容,需要還原就直接cp 出來就好
|
|
|
基本上每個目錄都只會佔用「異動」後的檔案空間</p>
|
|
|
|
|
|
<pre><code>du -sh *
|
|
|
125M 2018-04-10-155826
|
|
|
0 2018-04-10-155836
|
|
|
0 2018-04-10-160054
|
|
|
4.0K 2018-04-10-160224
|
|
|
0 2018-04-10-160719
|
|
|
0 backup.marker
|
|
|
4.0K latest
|
|
|
</code></pre>
|
|
|
|
|
|
<p>備份的策略在readme裡面有提到</p>
|
|
|
|
|
|
<p>一天之內,所有的備份都會被保留(前提是空間足夠)
|
|
|
一個月內,每一天的最後一份備份會被保留(或者說「最近」的一份)
|
|
|
超過一個月,每個月的最後一份備份會被保留(或者說「最近」的一份)</p>
|
|
|
|
|
|
<pre><code>The script automatically deletes old backups using the following logic:
|
|
|
|
|
|
Within the last 24 hours, all the backups are kept.
|
|
|
Within the last 31 days, the most recent backup of each day is kept.
|
|
|
After 31 days, only the most recent backup of each month is kept.
|
|
|
Additionally, if the backup destination directory is full, the oldest backups are deleted until enough space is available.
|
|
|
</code></pre>
|
|
|
|
|
|
<p>original link : <a href="https://github.com/laurent22/rsync-time-backup">https://github.com/laurent22/rsync-time-backup</a></p>
|
|
|
|
|
|
<p>README.md</p>
|
|
|
|
|
|
<h1 id="rsync-time-backup">Rsync time backup</h1>
|
|
|
|
|
|
<p>This script offers Time Machine-style backup using rsync. It creates incremental backups of files and directories to the destination of your choice. The backups are structured in a way that makes it easy to recover any file at any point in time.</p>
|
|
|
|
|
|
<p>It works on Linux, macOS and Windows (via WSL or Cygwin). The main advantage over Time Machine is the flexibility as it can backup from/to any filesystem and works on any platform. You can also backup, for example, to a Truecrypt drive without any problem.</p>
|
|
|
|
|
|
<p>On macOS, it has a few disadvantages compared to Time Machine - in particular it does not auto-start when the backup drive is plugged (though it can be achieved using a launch agent), it requires some knowledge of the command line, and no specific GUI is provided to restore files. Instead files can be restored by using any file explorer, including Finder, or the command line.</p>
|
|
|
|
|
|
<h2 id="installation">Installation</h2>
|
|
|
|
|
|
<p>git clone <a href="https://github.com/laurent22/rsync-time-backup">https://github.com/laurent22/rsync-time-backup</a></p>
|
|
|
|
|
|
<h2 id="usage">Usage</h2>
|
|
|
|
|
|
<p>Usage: rsync_tmbackup.sh [OPTION]… <[USER@HOST:]SOURCE> <[USER@HOST:]DESTINATION> [exclude-pattern-file]</p>
|
|
|
|
|
|
<p>Options
|
|
|
-p, –port SSH port.
|
|
|
-h, –help Display this help message.
|
|
|
–rsync-get-flags Display the default rsync flags that are used for backup.
|
|
|
–rsync-set-flags Set the rsync flags that are going to be used for backup.
|
|
|
–log-dir Set the log file directory. If this flag is set, generated files will
|
|
|
not be managed by the script - in particular they will not be
|
|
|
automatically deleted.</p>
|
|
|
|
|
|
<h2 id="features">Features</h2>
|
|
|
|
|
|
<ul>
|
|
|
<li><p>Each backup is on its own folder named after the current timestamp. Files can be copied and restored directly, without any intermediate tool.</p></li>
|
|
|
|
|
|
<li><p>Backup to/from remote destinations over SSH.</p></li>
|
|
|
|
|
|
<li><p>Files that haven’t changed from one backup to the next are hard-linked to the previous backup so take very little extra space.</p></li>
|
|
|
|
|
|
<li><p>Safety check - the backup will only happen if the destination has explicitly been marked as a backup destination.</p></li>
|
|
|
|
|
|
<li><p>Resume feature - if a backup has failed or was interrupted, the tool will resume from there on the next backup.</p></li>
|
|
|
|
|
|
<li><p>Exclude file - support for pattern-based exclusion via the <code>--exclude-from</code> rsync parameter.</p></li>
|
|
|
|
|
|
<li><p>Automatically purge old backups - within 24 hours, all backups are kept. Within one month, the most recent backup for each day is kept. For all previous backups, the most recent of each month is kept.</p></li>
|
|
|
|
|
|
<li><p>“latest” symlink that points to the latest successful backup.</p></li>
|
|
|
</ul>
|
|
|
|
|
|
<h2 id="examples">Examples</h2>
|
|
|
|
|
|
<ul>
|
|
|
<li>Backup the home folder to backup_drive
|
|
|
<br /></li>
|
|
|
</ul>
|
|
|
|
|
|
<p>rsync_tmbackup.sh /home /mnt/backup_drive</p>
|
|
|
|
|
|
<ul>
|
|
|
<li>Backup with exclusion list:
|
|
|
<br /></li>
|
|
|
</ul>
|
|
|
|
|
|
<p>rsync_tmbackup.sh /home /mnt/backup_drive excluded_patterns.txt</p>
|
|
|
|
|
|
<ul>
|
|
|
<li>Backup to remote drive over SSH, on port 2222:</li>
|
|
|
</ul>
|
|
|
|
|
|
<p>rsync_tmbackup.sh -p 2222 /home user@example.com:/mnt/backup_drive</p>
|
|
|
|
|
|
<ul>
|
|
|
<li>Backup from remote drive over SSH:</li>
|
|
|
</ul>
|
|
|
|
|
|
<p>rsync_tmbackup.sh user@example.com:/home /mnt/backup_drive</p>
|
|
|
|
|
|
<ul>
|
|
|
<li>To mimic Time Machine’s behaviour, a cron script can be setup to backup at regular interval. For example, the following cron job checks if the drive “/mnt/backup” is currently connected and, if it is, starts the backup. It does this check every 1 hour.</li>
|
|
|
</ul>
|
|
|
|
|
|
<p>0 */1 * * * if [[ -d /mnt/backup ]]; then rsync_tmbackup.sh /home /mnt/backup; fi</p>
|
|
|
|
|
|
<h2 id="backup-expiration-logic">Backup expiration logic</h2>
|
|
|
|
|
|
<p>The script automatically deletes old backups using the following logic:
|
|
|
- Within the last 24 hours, all the backups are kept.
|
|
|
- Within the last 31 days, the most recent backup of each day is kept.
|
|
|
- After 31 days, only the most recent backup of each month is kept.
|
|
|
- Additionally, if the backup destination directory is full, the oldest backups are deleted until enough space is available.</p>
|
|
|
|
|
|
<h2 id="exclude-file">Exclude file</h2>
|
|
|
|
|
|
<p>An optional exclude file can be provided as a third parameter. It should be compatible with the <code>--exclude-from</code> parameter of rsync. See <a href="https://sites.google.com/site/rsync2u/home/rsync-tutorial/the-exclude-from-option">this tutorial</a> for more information.</p>
|
|
|
|
|
|
<h2 id="built-in-lock">Built-in lock</h2>
|
|
|
|
|
|
<p>The script is designed so that only one backup operation can be active for a given directory. If a new backup operation is started while another is still active (i.e. it has not finished yet), the new one will be automaticalled interrupted. Thanks to this the use of <code>flock</code> to run the script is not necessary.</p>
|
|
|
|
|
|
<h2 id="rsync-options">Rsync options</h2>
|
|
|
|
|
|
<p>To display the rsync options that are used for backup, run <code>./rsync_tmbackup.sh --rsync-get-flags</code>. It is also possible to add or remove options using the <code>--rsync-set-flags</code> option. For example, to exclude backing up permissions and groups:</p>
|
|
|
|
|
|
<p>rsync_tmbackup –rsync-set-flags “–numeric-ids –links –hard-links <br />
|
|
|
–one-file-system –archive –no-perms –no-groups –itemize-changes” /src /dest</p>
|
|
|
|
|
|
<h2 id="how-to-restore">How to restore</h2>
|
|
|
|
|
|
<p>The script creates a backup in a regular directory so you can simply copy the files back to the original directory. You could do that with something like <code>rsync -aP /path/to/last/backup/ /path/to/restore/to/</code>. Consider using the <code>--dry-run</code> option to check what exactly is going to be copied. Use <code>--delete</code> if you also want to delete files that exist in the destination but not in the backup (obviously extra care must be taken when using this option).</p>
|
|
|
|
|
|
<h2 id="extensions">Extensions</h2>
|
|
|
|
|
|
<ul>
|
|
|
<li><a href="https://github.com/thomas-mc-work/rtb-wrapper">rtb-wrapper</a>: Allows creating backup profiles in config files. Handles both backup and restore operations.</li>
|
|
|
<li><a href="https://github.com/joekerna/time-travel">time-travel</a>: Smooth integration into OSX Notification Center</li>
|
|
|
</ul>
|
|
|
|
|
|
<h2 id="todo">TODO</h2>
|
|
|
|
|
|
<ul>
|
|
|
<li>Check source and destination file-system (<code>df -T /dest</code>). If one of them is FAT, use the –modify-window rsync parameter (see <code>man rsync</code>) with a value of 1 or 2</li>
|
|
|
<li>Add <code>--whole-file</code> arguments on Windows? See <a href="http://superuser.com/a/905415/73619">http://superuser.com/a/905415/73619</a></li>
|
|
|
<li>Minor changes (see TODO comments in the source).</li>
|
|
|
</ul>
|
|
|
|
|
|
<h2 id="license">LICENSE</h2>
|
|
|
|
|
|
<p>The MIT License (MIT)</p>
|
|
|
|
|
|
<p>Copyright © 2013-2017 Laurent Cozic</p>
|
|
|
|
|
|
<p>Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
of this software and associated documentation files (the “Software”), to deal
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
furnished to do so, subject to the following conditions:</p>
|
|
|
|
|
|
<p>The above copyright notice and this permission notice shall be included in
|
|
|
all copies or substantial portions of the Software.</p>
|
|
|
|
|
|
<p>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
THE SOFTWARE.</p>
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="footer">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="tags">
|
|
|
<i class="fa fa-tags"></i>
|
|
|
<div class="links">
|
|
|
|
|
|
<a href="/tags/linux">linux</a>
|
|
|
|
|
|
<a href="/tags/tools">tools</a>
|
|
|
|
|
|
<a href="/tags/rsync">rsync</a>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</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">
|
|
|
©
|
|
|
|
|
|
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+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>
|