Skip to content

Instantly share code, notes, and snippets.

@icarrr
Created December 3, 2019 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icarrr/d497ef6e06744cec51edf23a43471a35 to your computer and use it in GitHub Desktop.
Save icarrr/d497ef6e06744cec51edf23a43471a35 to your computer and use it in GitHub Desktop.
Backup and Extract file compress lzma
  1. To backup files to type lzma, run the main.sh script.
  2. To extract files, use the following command:
xz -d file.tar.lzma
ls -l # check list file
tar -xvf file.tar
#!/bin/sh
export dateNow=$(TZ=Asia/Jakarta date '+%Y%m%d_%H%M%S')
tar --lzma -cvpf backup-$dateNow.tar.lzma sourceFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment