Tarsnap Command Examples
Tarsnap is a versatile command-line utility for creating secure, efficient, and cost-effective cloud backups. It utilizes data deduplication to minimize storage costs and bandwidth usage. Below are common Tarsnap commands for managing your backups.
Secure Cloud Backup Operations
This section covers the fundamental operations for backing up your data with Tarsnap, ensuring its security and integrity in the cloud.
Archive Management and Inspection
Learn how to effectively manage your Tarsnap archives, including listing, inspecting contents, and performing dry runs to estimate upload sizes.
Data Restoration and Recovery
Discover how to restore your data from Tarsnap archives, whether it's specific files, directories, or entire user home directories.
Advanced Tarsnap Usage
Explore more advanced functionalities of Tarsnap, such as copying archives between locations and understanding the underlying compression mechanisms.
---
tags: [ compression, backup, cloud ]
---
# Perform a backup of two directories
tarsnap -c -f <archive-name> /usr/home /other/stuff/to/backup
# Print how much data would be uploaded
tarsnap -c -f <archive-name> --dry-run --print-stats /usr/home /other/stuff/to/backup
# Copy an archive (only accesses metadata)
tarsnap -c -f <target-archive-name> @@<source-archive>
# List the archives
tarsnap --list-archives
# Delete an archive
tarsnap -d -f <archive-name>
# List the files in an archive
tarsnap -tv -f <archive-name>
# Restore two users' home directories from an archive (use no leading slashes)
tarsnap -x -f <archive-name> usr/home/alice usr/home/bob