I need help. I need to compress, (.tar) a file named file.text and append the date on its file name, from file.text, it should now be file_120724.tar.
The problem now with my below script is that it place the .tar file on the location where the script is located, not on the location of the original file likewise, it also compress the whole directory, not the file that I want to compress.
thanks Scott for the prompt reply. I tried the below command and it gives me what I am looking for, however, I am not that certain if it's safe in the production servers:
tar -zcvf /location/of/the/file/file.text_$(date +%y%m%d).tar /*/*/*/file.text
I really wanted to only compress the file.text, not including the directories where it reside, that's why I thought of using /*/*/*. Is there any way where I can only compress the file.text?