Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

gzip, tar files

Status
Not open for further replies.

jayjaybigs

IS-IT--Management
Jan 12, 2005
191
CA
Hello All,

I have couple of files named as follows:

file1.txt
file2.txt

I am intrested in zipping them up, tar, add date and move to another directory to make it look as follows:

allfiles.febuary.tgz

Here is my effort: This file is named myscript.sh
#!/usr/bin/sh

tar -czvf logfiles.date.tgz files1.txt files2.txt

mv logfiles.date.tgz new_location/

exit

HOwever, I am having some problems. Also, how can i ran this shell script without typeing:
bash myscript.sh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top