Advertisement
v1ral_ITS

Create backup archive with

Jan 15th, 2025
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.76 KB | None | 0 0
  1. To create a gzip-compressed archive using find, cpio, and gzip, you can use the following command:
  2.  
  3. find . | cpio -o | gzip > archive.cpio.gz
  4.  
  5. Explanation:
  6.     1find .: Lists all files and directories starting from the current directory (.).
  7.     2cpio -o: Takes the list of files from find and creates an archive in the cpio format (-o means “create archive”).
  8.     3.  gzip: Compresses the cpio archive.
  9.     4>: Redirects the compressed data to a file named archive.cpio.gz.
  10.  
  11. To extract the archive:
  12.  
  13. gunzip -c archive.cpio.gz | cpio -id
  14.  
  15.     • gunzip -c: Decompresses the file but writes the output to stdout.
  16.     • cpio -id: Extracts files from the archive. (-i means “extract”, and -d creates directories as needed).
  17.  
  18. Let me know if you need additional details!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement