Pane
Pane

Reputation: 1

Need help for shell script to copy multiple dir and packing into tar

Im amateur in script shell so i need help for shell cripting for my issue :

i have 2 directory inside this path /home/backup : CSC DFG

and each folder (CSC & DFG) have a these dir inside : weekly and monthly

and i want to copy all files and packing into 1 file .tar inside weekly dir > into monthly dir

so my question : hows the script for this my issue?

Thanks

Upvotes: 0

Views: 67

Answers (1)

Joey Ezekiel
Joey Ezekiel

Reputation: 1027

I'm not sure I understand your question, but if you want to create a tar file, here is the command (with verbose):

tar -cvf backup.tar /home/backup/*

and then if you need to compress it, which I assume you want to do:

gzip backup.tar

Upvotes: 1

Related Questions