Skip to content

Commit

Permalink
Merge pull request #69 from omar-polo/mandoc
Browse files Browse the repository at this point in the history
some doc changes
  • Loading branch information
poolpOrg authored Nov 12, 2024
2 parents 3f757b3 + 9c931a4 commit 6cf693b
Show file tree
Hide file tree
Showing 46 changed files with 809 additions and 754 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go install github.com/PlakarLabs/plakar/cmd/plakar@latest

## Documentation

For up-to-date informations,
For up-to-date information,
you can read the documentation available at https://docs.plakar.io


Expand Down
48 changes: 23 additions & 25 deletions cmd/plakar/subcommands/archive/archive.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.Dd November 3, 2024
.Dt PLAKAR ARCHIVE 1
.Dd November 12, 2024
.Dt PLAKAR-ARCHIVE 1
.Os
.Sh NAME
.Nm plakar archive
Expand All @@ -13,19 +13,22 @@
.Sh DESCRIPTION
The
.Nm
command creates an archive from the contents of a specified Plakar snapshot. Supported formats include
command creates an archive from the contents of a specified Plakar snapshot.
Supported formats include
.Cm tar ,
.Cm tarball ,
and
.Cm zip .
Archives can be output to a specified file or to standard output, with an option to rebase (remove leading directories) from archived paths.

Archives can be output to a specified file or to standard output, with
an option to rebase (remove leading directories) from archived paths.
.Bl -tag -width Ds
.It Fl output Ar pathname
Specify the output path for the archive file. If omitted, the archive is created with a default name based on the current date and time.

Specify the output path for the archive file.
If omitted, the archive is created with a default name based on the
current date and time.
.It Fl format Ar type
Specify the archive format. Supported formats are:
Specify the archive format.
Supported formats are:
.Bl -tag -width Ds
.It Cm tar
Creates a standard .tar file.
Expand All @@ -34,45 +37,40 @@ Creates a compressed .tar.gz file.
.It Cm zip
Creates a .zip archive.
.El

.It Fl rebase
Strip the leading path from archived files, useful for creating "flat" archives without nested directories.
Strip the leading path from archived files, useful for creating "flat"
archives without nested directories.
.El

.Sh ARGUMENTS
.Bl -tag -width Ds
.It Ar snapshotID
The ID of the snapshot to archive. A file path within the snapshot can also be specified to archive a subdirectory or single file.
The ID of the snapshot to archive.
A file path within the snapshot can also be specified to archive a
subdirectory or single file.
.El

.Sh EXAMPLES
To illustrate usage:

.Bl -tag -width Ds
.It Create a tarball of the entire snapshot:
Create a tarball of the entire snapshot:
.Bd -literal -offset indent
plakar archive -output backup.tar.gz -format tarball abc123
.Ed

.It Create a zip archive of a specific directory within a snapshot:
.Pp
Create a zip archive of a specific directory within a snapshot:
.Bd -literal -offset indent
plakar archive -output dir.zip -format zip abc123:/path/to/dir
.Ed

.It Archive with rebasing to remove directory structure:
.Pp
Archive with rebasing to remove directory structure:
.Bd -literal -offset indent
plakar archive -rebase -format tar abc123
.Ed
.El

.Sh DIAGNOSTICS
.Ex -std
.Bl -tag -width Ds
.It 0
Command completed successfully.
.It >0
An error occurred, such as unsupported format, missing files, or permission issues.
An error occurred, such as unsupported format, missing files, or
permission issues.
.El

.Sh SEE ALSO
.Xr plakar 1
49 changes: 22 additions & 27 deletions cmd/plakar/subcommands/backup/backup.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.Dd November 3, 2024
.Dt PLAKAR BACKUP 1
.Dd November 12, 2024
.Dt PLAKAR-BACKUP 1
.Os
.Sh NAME
.Nm plakar backup
Expand All @@ -15,61 +15,56 @@
.Sh DESCRIPTION
The
.Nm
command creates a new snapshot of a directory in a Plakar repository, storing it with an optional tag and exclusion patterns. Snapshots can be filtered to exclude specific files or directories based on patterns provided through options.

command creates a new snapshot of a directory in a Plakar repository,
storing it with an optional tag and exclusion patterns.
Snapshots can be filtered to exclude specific files or directories
based on patterns provided through options.
.Bl -tag -width Ds
.It Fl concurrency Ar number
Set the maximum number of parallel tasks for faster processing. Defaults to
Set the maximum number of parallel tasks for faster processing.
Defaults to
.Dv 8 * CPU count + 1 .

.It Fl tag Ar tag
Specify a tag to assign to the snapshot for easier identification.

.It Fl excludes Ar file
Specify a file containing exclusion patterns, one per line, to ignore files or directories in the backup.

Specify a file containing exclusion patterns, one per line, to ignore
files or directories in the backup.
.It Fl exclude Ar pattern
Specify individual exclusion patterns to ignore files or directories in the backup. This option can be repeated.
.El

Specify individual exclusion patterns to ignore files or directories
in the backup.
This option can be repeated.
.It Fl quiet
Suppress output to standard input, only logging errors and warnings.
.El

.Sh ARGUMENTS
.Bl -tag -width Ds
.It Ar directory
(Optional) The directory to back up. If omitted, the current working directory is used.
(Optional) The directory to back up.
If omitted, the current working directory is used.
.El

.Sh EXAMPLES
To illustrate usage:

.Bl -tag -width Ds
.It Create a snapshot of the current directory with a tag:
Create a snapshot of the current directory with a tag:
.Bd -literal -offset indent
plakar backup -tag "daily_backup"
.Ed

.It Backup a specific directory with exclusion patterns from a file:
.Pp
Backup a specific directory with exclusion patterns from a file:
.Bd -literal -offset indent
plakar backup -excludes /path/to/exclude_file /path/to/directory
.Ed

.It Backup a directory with specific file exclusions:
.Pp
Backup a directory with specific file exclusions:
.Bd -literal -offset indent
plakar backup -exclude "*.tmp" -exclude "*.log" /path/to/directory
.Ed
.El

.Sh DIAGNOSTICS
.Ex -std
.Bl -tag -width Ds
.It 0
Command completed successfully, snapshot created.
.It >0
An error occurred, such as failure to access the repository or issues with exclusion patterns.
An error occurred, such as failure to access the repository or issues
with exclusion patterns.
.El

.Sh SEE ALSO
.Xr plakar 1
36 changes: 15 additions & 21 deletions cmd/plakar/subcommands/cat/cat.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.Dd November 3, 2024
.Dt PLAKAR CAT 1
.Dd November 12, 2024
.Dt PLAKAR-CAT 1
.Os
.Sh NAME
.Nm plakar cat
Expand All @@ -12,53 +12,47 @@
.Sh DESCRIPTION
The
.Nm
command outputs the contents of files within Plakar snapshots to the standard output. It can decompress compressed files and optionally apply syntax highlighting based on the file type.

command outputs the contents of files within Plakar snapshots to the
standard output.
It can decompress compressed files and optionally apply syntax
highlighting based on the file type.
.Bl -tag -width Ds
.It Fl no-decompress
Display the file content as-is, without attempting to decompress it, even if it is compressed.

Display the file content as-is, without attempting to decompress it,
even if it is compressed.
.It Fl highlight
Apply syntax highlighting to the output based on the file type.
.El

.Sh ARGUMENTS
.Bl -tag -width Ds
.It Ar snapshotID
The ID of the snapshot containing the file to display.

.It Ar filepath
One or more file paths within the snapshot to display.
.El

.Sh EXAMPLES
To illustrate usage:

.Bl -tag -width Ds
.It Display a file's contents from a snapshot:
Display a file's contents from a snapshot:
.Bd -literal -offset indent
plakar cat abc123 /path/to/file.txt
.Ed

.It Display a compressed file without decompression:
.Pp
Display a compressed file without decompression:
.Bd -literal -offset indent
plakar cat -no-decompress abc123 /path/to/compressed.gz
.Ed

.It Display a file with syntax highlighting:
.Pp
Display a file with syntax highlighting:
.Bd -literal -offset indent
plakar cat -highlight abc123 /path/to/script.sh
.Ed
.El

.Sh DIAGNOSTICS
.Ex -std
.Bl -tag -width Ds
.It 0
Command completed successfully.
.It >0
An error occurred, such as failure to retrieve a file or decompress content.
An error occurred, such as failure to retrieve a file or decompress
content.
.El

.Sh SEE ALSO
.Xr plakar 1
38 changes: 18 additions & 20 deletions cmd/plakar/subcommands/checksum/checksum.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.Dd November 3, 2024
.Dt PLAKAR CHECKSUM 1
.Dd November 12, 2024
.Dt PLAKAR-CHECKSUM 1
.Os
.Sh NAME
.Nm plakar checksum
Expand All @@ -11,47 +11,45 @@
.Sh DESCRIPTION
The
.Nm
command calculates and displays checksums for specified files in a Plakar snapshot. By default, the command computes the checksum by reading the file contents. The
command calculates and displays checksums for specified files in a
Plakar snapshot.
By default, the command computes the checksum by reading the file
contents.
The
.Fl fast
option enables the use of the pre-recorded checksum, which is faster but does not verify file integrity against current contents.

option enables the use of the pre-recorded checksum, which is faster
but does not verify file integrity against current contents.
.Bl -tag -width Ds
.It Fl fast
Return the pre-recorded checksum for the file without re-computing it from the file contents.
Return the pre-recorded checksum for the file without re-computing it
from the file contents.
.El

.Sh ARGUMENTS
.Bl -tag -width Ds
.It Ar snapshotID
The ID of the snapshot to check.

.It Ar filepath
One or more paths within the snapshot for which to compute or retrieve checksums.
One or more paths within the snapshot for which to compute or retrieve
checksums.
.El

.Sh EXAMPLES
To illustrate usage:

.Bl -tag -width Ds
.It Calculate the checksum of a file within a snapshot:
Calculate the checksum of a file within a snapshot:
.Bd -literal -offset indent
plakar checksum abc123 /path/to/file.txt
.Ed

.It Retrieve the pre-recorded checksum for faster output:
.Pp
Retrieve the pre-recorded checksum for faster output:
.Bd -literal -offset indent
plakar checksum -fast abc123 /path/to/file.txt
.Ed
.El

.Sh DIAGNOSTICS
.Ex -std
.Bl -tag -width Ds
.It 0
Command completed successfully.
.It >0
An error occurred, such as failure to retrieve a file's checksum or invalid snapshot ID.
An error occurred, such as failure to retrieve a file's checksum or
invalid snapshot ID.
.El

.Sh SEE ALSO
.Xr plakar 1
24 changes: 10 additions & 14 deletions cmd/plakar/subcommands/cleanup/cleanup.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.Dd November 3, 2024
.Dt PLAKAR CLEANUP 1
.Dd November 12, 2024
.Dt PLAKAR-CLEANUP 1
.Os
.Sh NAME
.Nm plakar cleanup
Expand All @@ -9,32 +9,28 @@
.Sh DESCRIPTION
The
.Nm
command removes unused blobs, objects, and chunks from a Plakar repository to reduce storage space. It identifies unreferenced data and reorganizes packfiles to ensure only active snapshots and their dependencies are retained. The cleanup process updates snapshot indexes to reflect these changes.

command removes unused blobs, objects, and chunks from a Plakar
repository to reduce storage space.
It identifies unreferenced data and reorganizes packfiles to ensure
only active snapshots and their dependencies are retained.
The cleanup process updates snapshot indexes to reflect these changes.
.Sh OPTIONS
No options are available for this command.

.Sh ARGUMENTS
None.

.Sh EXAMPLES
To illustrate usage:

.Bl -tag -width Ds
.It Run cleanup to reclaim storage space:
Run cleanup to reclaim storage space:
.Bd -literal -offset indent
plakar cleanup
.Ed
.El

.Sh DIAGNOSTICS
.Ex -std
.Bl -tag -width Ds
.It 0
Command completed successfully.
.It >0
An error occurred during cleanup, such as failure to update indexes or remove data.
An error occurred during cleanup, such as failure to update indexes or
remove data.
.El

.Sh SEE ALSO
.Xr plakar 1
Loading

0 comments on commit 6cf693b

Please sign in to comment.