---
title: smc
url: 'https://www.dalan.fr/en/tools/smc'
markdown: 'https://www.dalan.fr/en/tools/smc.md'
lang: en
date: '2024-03-11'
description: 'Presentation Tool to save code and other files. Usage Config file Create a config file named smc.toml. [profiles] [profiles.toto] # Profile name paths = ["./"] # Path to include files = ["./"] # Files to include output = "/tmp" # Output dir or filen…'
taxonomy:
  archives_month:
    - mar_2024
  archives_year:
    - '2024'
---

# smc

### Presentation

Tool to save code and other files.

### Usage

#### Config file

Create a config file named `smc.toml`.

```toml
[profiles]
[profiles.toto]             # Profile name
paths = ["./"]              # Path to include
files = ["./"]              # Files to include
output = "/tmp"             # Output dir or filename (default: "./${CURRENT_DIR}_${TIME}${EXT}")
hidden = true               # Save also hidden (default: false)
gitignore = true            # Follow gitignore (default: true)
container = "Zip"           # Container [None, Zip, SevenZip, Tar] (default: Zip)
compression = "Bzip2"       # Compression if possible [None, Deflate, Bzip2, Bzip3, Zstd, Gzip, Xz, Lzma, Lzma2, Brotli, Ppmd, Lz4] (default: Deflate)
compression_level = 9       # Compression level if possible 
directory = "."             # Current directory (default: ".")
signatures = ["Sha256"]     # Signatures to generate [Blake3, Sha256, Sha384, Sha512, Sha3_256, Sha3_384, Sha3_512, Minisign, OpenPGP]
all_signature = ["Sha256"]  # Signatures to generate [Blake3, Sha256, Sha384, Sha512, Sha3_256, Sha3_384, Sha3_512] for all files saved
ignore = ["Cargo.*"]        # Files to ignore
whitelist = [".gitignore"]  # Whitelist files
metadata = true             # Write metadata in the output container (default: false)
destination = "my_test"     # Specify a destination for all files in the output container
```

Variables can be used in `output` and `save_dir` using `$VAR` or `${VAR}`:

| Name | Value |
|---|---|
| CURRENT\_DIR | Current directory |
| TIME | Current date and time |
| SAVE\_DIR | Save directory |
| TMP | Temp directory |
| EXT | Container extension |
| GIT\_COMMIT\_HASH | Git commit hash |
| GIT\_FULL\_COMMIT\_HASH | Git full commit hash |
| GIT\_BRANCH | Git branch |
| GIT\_TAG | Latest git tag |

#### Run

Run smc with the profiles names as arguments: `smc profile_name`.

Several profiles can be set. In this case all the files will be put in the first profile container.

Some command line arguments can be used to change profile.

### Download

##### Windows

A [binary is available](https://binaries.dalan.fr/smc/smc-v2.0.0-x86_64-pc-windows-gnu.zip) that you can check with its [sha512 checksum](https://binaries.dalan.fr/smc/smc-v2.0.0-x86_64-pc-windows-gnu.zip.sha512sum) or its [minisign](https://binaries.dalan.fr/smc/smc-v2.0.0-x86_64-pc-windows-gnu.zip.minisig) or [PGP](https://binaries.dalan.fr/smc/smc-v2.0.0-x86_64-pc-windows-gnu.zip.sig) signature.

##### Linux

A [binary is available](https://binaries.dalan.fr/smc/smc-v2.0.0-x86_64-unknown-linux-musl.tar.zst) that you can check with its [sha512 checksum](https://binaries.dalan.fr/smc/smc-v2.0.0-x86_64-unknown-linux-musl.tar.zst.sha512sum) or its [minisign](https://binaries.dalan.fr/smc/smc-v2.0.0-x86_64-unknown-linux-musl.tar.zst.minisig) or [PGP](https://binaries.dalan.fr/smc/smc-v2.0.0-x86_64-unknown-linux-musl.tar.zst.sig) signature.

The software is also available under [AUR](https://aur.archlinux.org/packages/smc/).

##### Other

It can be installed with `cargo install save_my_code` (need [a rust compiler](https://www.rust-lang.org) installed).

### Source code

The source code is available [on my git repository](https://codeberg.org/dalan/smc) under GPL v3 license.

---

## Navigation

- Parent: [Tools](https://www.dalan.fr/en/tools.md)
- Previous: [Simple Panorama Viewer](https://www.dalan.fr/en/tools/simplepanoramaviewer.md)
- Next: [notipriv](https://www.dalan.fr/en/tools/notipriv.md)
