41 lines
1,004 B
Markdown
41 lines
1,004 B
Markdown
---
|
|
title: "gzipping an existing tar"
|
|
date: 2020-10-14T09:12:54+02:00
|
|
draft: false
|
|
snippet_types:
|
|
- tar
|
|
- gzip
|
|
---
|
|
|
|
Part of my work process is taking lots of screenshot, ~5 per day. Then I back them up in AWS S3
|
|
Glacier once a month, using [freeze
|
|
app](https://apps.apple.com/us/app/freeze-for-amazon-glacier/id1046095491?mt=12). Like to start with
|
|
creating a regular tar file in /tmp.
|
|
|
|
```shell
|
|
$ tar cvf /tmp/pic_dump_14_10_20.tar ~/Desktop/**/*.png
|
|
```
|
|
|
|
Then append few more images. `r` in this case sanding for append..
|
|
|
|
```shell
|
|
$ tar rfv /tmp/pic_dump_14_10_20.tar ~/Pictures/resized/*
|
|
```
|
|
|
|
Now that the tar is complete I double check it by listing the files.
|
|
|
|
```shell
|
|
$ tar tf /tmp/pic_dump_14_10_20.tar
|
|
```
|
|
|
|
Lastly I need to compress the tar and I was confused if I could use tar command itself to compress a
|
|
tar into a tar.gz but turns you use gunzip.
|
|
|
|
```shell
|
|
$ gzip /tmp/pic_dump_14_10_20.tar
|
|
```
|
|
|
|
|
|
|
|
source: https://alvinalexander.com/blog/post/linux-unix/how-work-files-tar-gzip-tgz/ (4)
|
|
|