jayjaybigs
IS-IT--Management
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.May.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.May.tgz new_location/
exit
HOwever, I am having some problems. Also, how can i ran this shell script without typeing:
bash myscript.sh
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.May.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.May.tgz new_location/
exit
HOwever, I am having some problems. Also, how can i ran this shell script without typeing:
bash myscript.sh