Web Hosting Talk







View Full Version : Moving files?


The Laughing Cow
08-22-2002, 05:45 AM
Hi,

I have a resellers account on a Cpanel server. I would like to move a directory on one of my accounts into another one of my accounts. For example I think the directory structure is something along these lines..

home/myresellersaccount/myaccount1/directorytobemoved
home/myresellersaccount/myaccount2/

Can I SSH into my resellers account domain and have powers to move this directory? From what I see my SSH access seems to start at the myaccount1 folder.

MotleyFool
08-22-2002, 05:52 AM
It depends on how the permissions on the /home directory are set. A security conscious host will set it to chmod 711.. so if you log as account1 you can only access /home/account1 and you cant move it /home/account2

One way is to tarball the directory and ftp it to your local PC and then FTP it into /home/account2 and then untarring it

Hope this helps

combs
08-22-2002, 12:49 PM
You cannot SSH the directory from one account into another. You need some middle place to keep the directory while you switch the accounts. So, you can download the folder on your local pc from first account and then connect to second account and upload it from your local pc. Thanks

jahsh
08-22-2002, 04:26 PM
try this:
cd home/myresellersaccount/myaccount1
tar -zcvf filename.tar.gz directorytobemoved
mv filename.tar.gz home/myresellersaccount/myaccount2/
tar -zxvf filename.tar.gz
that should do it:stickout

Brewer
08-22-2002, 05:06 PM
Originally posted by jahsh
try this:
cd home/myresellersaccount/myaccount1
tar -zcvf filename.tar.gz directorytobemoved
mv filename.tar.gz home/myresellersaccount/myaccount2/
tar -zxvf filename.tar.gz
that should do it:stickout

One note to add, try tar -xvpzf instead of just tar -zxvf. This preserves all file permissions so you don't have to go back and chmod all your scripts again.

dandanfirema
08-22-2002, 05:18 PM
Or, just ask your webhost provider to do it for you. This should be really easy for them to handle.

bitserve
08-22-2002, 09:27 PM
From your login at home/myresellersaccount/myaccount1/:

tar --ignore-zeros -cz directorytobemoved | ssh -l username 2nd.account tar -xz

The Laughing Cow
08-23-2002, 10:35 AM
Well, I navigated through SSH into what I think is the home directory where I saw the list of all the users on the server. I went to the one I wanted to move to and CD'ed but I was denied access which I completly understand as that could be someone elses account for example. I think it would be a good cpanel feature if resellers had ssh access with permission to access all their accounts.

The files are about 150mb so i'll ask my webhost to move them most likley.
Thanks

bitserve
08-24-2002, 01:42 PM
If you have SSH access for both accounts, the way I posted should work.

The Laughing Cow
08-24-2002, 02:22 PM
Thanks bitserve, I get "Name or service cannot be found"

bitserve
08-24-2002, 10:21 PM
Sorry, logged into account one, from inside the home/myresellersaccount/myaccount1/ directory:

tar --ignore-zeros -cz directorytobemoved | ssh -l username 2nd.account tar -xz

Where "directorytobemoved" is the name of a directory, "username" is the username for the second account, and "2nd.account" is the IP address or name that you specify when connecting to your second account. Since they're both on the same server, you may be able to use "localhost" in place of an IP address or name. Also, you may need to specify a path to the "tar" or "ssh" command.

which ssh
which tar

If one of these commands isn't in your path, you'll need to locate the command with locate perhaps:

locate ssh
locate tar

So that you might actually have to type:

/bin/tar --ignore-zeros -cz directorytobemoved | /usr/local/bin/ssh -l username 2nd.account /bin/tar -xz

or some such.

Webdude
08-25-2002, 03:45 AM
Wht bother with tar??

cp -Rfup /this/directory /to/here/

Simple really....you keep all the same permissions and ownerships as well. Then you get anything else worked out that you need to do, and go back and delete the first one.

The Laughing Cow
08-25-2002, 06:37 AM
Thanks for the continuing help

I get

bash-2.05$ tar -- ignore zeros -cz photos | ssh -1 2ndusername 66.xxx.86.x tar -xz tar: You must specify one of the `-Acdtrux' options
Try `tar --help' for more information.
ssh: 2ndusername: Name or service not known

joshp
08-25-2002, 06:43 AM
tar the dir. login to the other account and use wget to move it. login to the old account and delete it.

bitserve
08-25-2002, 02:25 PM
Originally posted by Webdude
Wht bother with tar??

cp -Rfup /this/directory /to/here/

Simple really....you keep all the same permissions and ownerships as well. Then you get anything else worked out that you need to do, and go back and delete the first one.

Terry doesn't have access to copy to the destination directory.

bitserve
08-25-2002, 02:26 PM
Originally posted by The Laughing Cow
Thanks for the continuing help

I get

bash-2.05$ tar -- ignore zeros -cz photos | ssh -1 2ndusername 66.xxx.86.x tar -xz tar: You must specify one of the `-Acdtrux' options
Try `tar --help' for more information.
ssh: 2ndusername: Name or service not known

You're not typing it correctly:

You're typing:

tar -- ignore zeros -cz photos | ssh -1 2ndusername 66.xxx.86.x tar -xz

You should be typing:

tar --ignore-zeros -cz photos | ssh -l 2ndusername 66.xxx.86.x tar -xz

Webdude
08-25-2002, 03:06 PM
Ah ok...I guess I missed that..