Merge branch 'master' of github.com:LukeSmithxyz/landchad

This commit is contained in:
Luke Smith 2021-07-13 14:40:27 -04:00
commit 420bf720da
No known key found for this signature in database
GPG Key ID: 4C50B54A911F6252
2 changed files with 8 additions and 8 deletions

View File

@ -20,7 +20,7 @@
You can schedule anything! Some examples of what you might have done already include:
<ul>
<li><code>updatedb</code> to update your <code>locate</code> database</li>
<li><code>certbot</code> to update renewing of your https certs</li>)
<li><code>certbot</code> to update renewing of your https certs</li>
</ul>
Some tasks that you might <em>want</em> to schedule may include:
<ul>
@ -47,9 +47,9 @@
Crontab expressions look like this <code>* * * * * command-to-run</code>
The five elements before the command tell when the command is supposed to be run automatically.
<p>
So for our Monday at 3:30AM job we would do the following:
So for our Monday at 3:30 AM job we would do the following:
<p>
<pre><code>.---------------- minute (0 - 59)
<pre><code> .---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12)

View File

@ -20,14 +20,14 @@
<pre><code>apt install rsync</code></pre>
<h2 id="uploading-files-with-rsync">Uploading files with rsync</h2>
<p>From your local machine you can upload files to your server like this:</p>
<pre><code>rsync -ruvzP <strong>/path/to/file</strong> <strong>root@example.org:/path/on/the/server</strong></code></pre>
<pre><code>rsync -rtvzP <strong>/path/to/file</strong> <strong>root@example.org:/path/on/the/server</strong></code></pre>
<p>You will be prompted for the root password and then uploading will commence.</p>
<p>If you omit <strong>root@</strong>, rsync will not attempt to log in as root, but whatever your local username is.</p>
<h3>Options to rsync</h3>
<p>In this command, we give several options to rsync:</p>
<ul>
<li><code>-r</code> &ndash; run recurssively (include directories)</li>
<li><code>-u</code> &ndash; update files (do not reupload files that are not changed since last upload)</li>
<li><code>-t</code> &ndash; transfer modification times, which allows skipping files that have not been modified on future uploads</li>
<li><code>-v</code> &ndash; visual, show files uploaded</li>
<li><code>-z</code> &ndash; compress files for upload</li>
<li><code>-P</code> &ndash; if uploading a large file and upload breaks, pick up where we left off rather than reuploading the entire file</li>
@ -39,14 +39,14 @@
<p>To avoid having to manually input your password each upload, you can set up <a href="sshkeys.html">SSH keys</a> to securely idenitify yourself and computer as a trusted.</p>
<h3>Picky trailing slashes</h3>
<p>rsync is very particular about trailing slashes. This is useful, but can be confusing to some new users. Suppose we run the following wanting to mirror our offline copy of our website in the directory we use on our server (<code>/var/www/websitefiles/</code>):</p>
<pre><code>rsync -ruvzP ~/<strong>websitefiles/</strong> root@example.org:/var/www/<strong>websitefiles/</strong></code></pre>
<pre><code>rsync -rtvzP ~/<strong>websitefiles/</strong> root@example.org:/var/www/<strong>websitefiles/</strong></code></pre>
<p>This will <em>not actually do quite what we want</em>. It will take our local <code>websitefiles</code> directory and put it <em>inside</em> <code>websitefiles</code> on the remote machine, ending up with: <code>/var/www/websitefiles/websitefiles</code>.</p>
<p>Instead, remove the trailing slash from the remote server location:</p>
<pre><code>rsync -ruvzP ~/<strong>websitefiles/</strong> root@example.org:/var/www/<strong>websitefiles</strong></code></pre>
<pre><code>rsync -rtvzP ~/<strong>websitefiles/</strong> root@example.org:/var/www/<strong>websitefiles</strong></code></pre>
<p><code>websitefiles/</code> has been replaced with <code>websitefiles</code>, and this will do what we want.</p>
<h2 id="downloading-file-with-rsync">Downloading files with rsync</h2>
<p>You may just as easily download files and directories from your server with rsync:</p>
<pre><code>rsync -urvzP <strong>root@example.org:/path/to/file</strong> <strong>/path/to/file</strong></code></pre>
<pre><code>rsync -rtvzP <strong>root@example.org:/path/to/file</strong> <strong>/path/to/file</strong></code></pre>
<h2 id="contribution">Contribution</h2>
<ul><li>el3ctr0lyte: <a href="https://github.com/el3ctr0lyte">github</a>, XMR: <code class=crypto>86DBJdiG83ZDea6kJgsbVN5tMae5ScfuhJ3PihEMTHatCrGEw2gctyUB92V2fz4R4YhwRaQeAGL5M4gPRXvVvtkULJi4ayk</code></li><li>Substantial revisions by <a href="https://lukesmith.xyz">Luke</a></li></ul>
</main>