> For the complete documentation index, see [llms.txt](https://doane-ccla.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doane-ccla.gitbook.io/docs/learning-linux/essential-commands/backup.md).

# Script: Backup

```bash
#!/bin/bash

SRC_DIR="/Users/user/Documents/my_work/"

DEST_DIR="/Users/user/Backups/"

FILENAME=Backup-$(date +%-Y%-m%-d)-$(date +%-T).tgz

tar --create --gzip --file=$DEST_DIR$FILENAME $SRC_DIR
```

Back to [Essential Commands](/docs/learning-linux/essential-commands.md)
