Hi,
I have my log files in /home/user1/temp2/logs i want to archive
*.log and *.txt files and to store in my /home/user1/temp2/archved/
with *.log with Time stamp ,Please let me know how to do this?
In its simplest form
$ cd /home/user1/temp2/logs
$ tarfile="my_archive_`date +%d%m%y`.tar"
$ tar cvf ${tarfile} *.log *.txt
$ mv ${tarfile} /home/user1/temp2/archived/
If you have a lot of files you might need to use find with xargs as the shell evaluates *.log and *.txt (be careful not to clobber the original archive if using tar to do this, a slow solution to this can be found here).
There are many other ways of doing this, involving cpio, a plain old copy (with -p to preserve timestamps), etc... You can also apply gzip, bzip2 and other forms of compression on the archive.
Cheers
ZB