Linux/Restic: Difference between revisions

From Wiki
No edit summary
Line 1: Line 1:
== Create repository ==
== Create repository ==
<blockquote><pre>
<blockquote><pre>
restic init --repo /srv/restic-repo                      # local
restic --repo /srv/restic-repo init                     # local
restic init --repo sftp:user@host:/srv/restic-repo      # sftp
restic --repo sftp:user@host:/srv/restic-repo init       # sftp
restic init --repo b2:bucketname:path/to/repo            # backblaze b2
restic --repo b2:bucketname:path/to/repo init           # backblaze b2
</pre></blockquote>
</pre></blockquote>


Line 14: Line 14:
== Backup ==
== Backup ==
<blockquote><pre>
<blockquote><pre>
restic backup --verbose --repo /srv/restic-repo ~/work
restic --repo /srv/restic-repo --verbose backup ~/work
 
restic --repo /srv/restic-repo backup ~/work --exclude="*.c" --exclude-file=excludes.txt 
restic -r /srv/restic-repo backup --files-from /tmp/files_to_backup
</pre></blockquote>
</pre></blockquote>



Revision as of 10:18, 27 August 2020

Create repository

restic --repo /srv/restic-repo init                      # local
restic --repo sftp:user@host:/srv/restic-repo init       # sftp
restic --repo b2:bucketname:path/to/repo init            # backblaze b2

Backblaze

export B2_ACCOUNT_ID=<MY_APPLICATION_KEY_ID>
export B2_ACCOUNT_KEY=<MY_APPLICATION_KEY>

Backup

restic --repo /srv/restic-repo --verbose backup ~/work

restic --repo /srv/restic-repo backup ~/work --exclude="*.c" --exclude-file=excludes.txt   
restic -r /srv/restic-repo backup --files-from /tmp/files_to_backup

Restoring