Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
tar find ssh
Name: kabphx Date: May 17, 2004 at 18:37:03 Pacific OS: linux CPU/Ram: p4 512
Comment:
hi i am trying to get a bunch of zip files from a box to my box and using this command
ssh myname@boxname "( cd /logs; tar cf - find -name \"*.Z\" )" | tar xf -
this command should copy all the zip files from the remote boxname to the local directory while maintaining the same directory structure. but the above command is not working something is going wrong getting this error message tar: invalid option -- n Try `tar --help' for more information.
but if i want to copy the directory structure it is working fine
ssh myname@boxname "( cd /logs; tar cf - w* )" | tar xf - recursively copies all the directories starting with w*
if you can let me know any other way of copying all *.Z files and maintaining the same directory structure on the local box
Name: Dlonra Date: May 18, 2004 at 14:44:44 Pacific
Reply:
tar cf - find -name \"*.Z\" looks erroneous
perhaps tar cf - $(find -name \"*.Z\" )
0
Response Number 2
Name: Dlonra Date: May 18, 2004 at 14:49:12 Pacific
Reply:
sorry, should be tar cf - $(find . -name \"*.Z\" )
0
Response Number 3
Name: kabphx Date: May 18, 2004 at 17:52:46 Pacific
Reply:
i tried the above step now find command in $(find . -name \"*.Z\") is listing all the *.Z files of the local box and not the remote box.
what i have observerd is it is executing only one command on the remote box here on the above command we see that it starts tar cf - on the remote box and whatever is given in `... ` or $(... ) the quotes will be run on the local box not the remote box.
the whole purpose is to get a bunch of *.Z files located in different directories from remote machine to local machine maintaining the same directory structure.
thanks
anil
0
Response Number 4
Name: Dlonra Date: May 18, 2004 at 18:25:19 Pacific
Summary: Mmmmm. Now I'm just annoying everyone. I've tried the following and it does NOT work - tar cvf file.tar 'find /origdir -type f -mtime +180 -print'. It tells me that the directory/file does not exist....
Summary: Hi, please find the final version which has been improved. Forgive my haste but I never planned on upgrading / improving it until posting it on here!! If you change / improve / edit this - please s...
Summary: Hi: 1. I have a list of files in a directory. This directory can contain a normal file or a tar file of the format *.tar.*, where * is wild character. Now to find out whether t...