Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-11-2010, 10:45 AM   #1
Inter-Sex
Confirmed User
 
Industry Role:
Join Date: Nov 2005
Location: Spain :)
Posts: 2,231
Question : SSH / Copy / Same Path...HELP ! ! !

Hello

I need some help, so if you have time...don't stop reading.

SSH is not my strongest point. I have for example 20 times the dir "clips" at my server, (under different domains)
and would like to do a search just in those dirs "clips", to "*.ext"
(the "clips" directory has other dirs in it : path /clips/clip33/clips33-a/*)

After that i would like to copy all found files to a new directory, but if it is posible i would like to get
the same structure in the new directory. So in the new dir would look like this "NEW-Dir/clips/clip33/clips33-a/*"

Which commands i have to use for all this ?

If somebody can help me with a ssh string, that would be great and saves me a lot of work manually.

Thank you in advance.

~ Renaldo,
Inter-Sex is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2010, 11:15 AM   #2
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,270
Quote:
Originally Posted by Inter-Sex View Post
Hello

I need some help, so if you have time...don't stop reading.

SSH is not my strongest point. I have for example 20 times the dir "clips" at my server, (under different domains)
and would like to do a search just in those dirs "clips", to "*.ext"
(the "clips" directory has other dirs in it : path /clips/clip33/clips33-a/*)

After that i would like to copy all found files to a new directory, but if it is posible i would like to get
the same structure in the new directory. So in the new dir would look like this "NEW-Dir/clips/clip33/clips33-a/*"

Which commands i have to use for all this ?

If somebody can help me with a ssh string, that would be great and saves me a lot of work manually.

Thank you in advance.

~ Renaldo,
This will take care of name collision, so if you have the same files in multiple directories.

find to get a list of all the files (just change the extension from .jpg to whatever
awk to create a copy command with the original filename and the modified filename
bash to pass it to the shell to be executed

Code:
find . -name "*.jpg" | awk '{ str=$0; sub(/\.\//, "", str); gsub(/\//, "-", str); print "cp " $0 " new/" str }' | bash
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-11-2010, 04:23 PM   #3
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,270
hope this worked for you
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.