Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
11-23-2012, 05:00 PM
|
#1
|
LQ Newbie
Registered: Nov 2012
Posts: 8
Rep: 
|
Stupid question about moving whole directory in Linux
Hello everything, I am new on this forum , I have a stupid question with cost me lot of time :
I have VPS from Godaddy Cent OS 6 .
Everythings good but :
For example I have linux1.com
/home/linux1/public_html/ FILES HERE
and I want to copy file to linux2.com in account I already have :
/home/linux2/public_html
-------------------
It's about wordpress.
The strange problem is that when i download files by ftp and upload to linux2.com everything is alright
But when i try to copy using cp -rp * into linux2 I got Internal Server Error .
I know that it should be a small mistake in copy comand, please help me because I loe everyday many hours because this simply comand. I guess is something about user right ,
Thanks in advance.
|
|
|
11-23-2012, 05:14 PM
|
#2
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
^ what user do you upload the files as ?
have you thought about using scp instead of ftp to do the file transfer.
Last edited by schneidz; 11-23-2012 at 05:16 PM.
|
|
|
11-23-2012, 05:27 PM
|
#3
|
LQ Newbie
Registered: Nov 2012
Posts: 8
Original Poster
Rep: 
|
i upload as normal user , then try to copy files loged as root from user to another user.
When i download files by ftp and reupload in next account is ok, when i copy files logged as root i get internal server error.
I guess is something in file permision copying, I am beginner . Thank you
|
|
|
11-23-2012, 10:38 PM
|
#4
|
Member
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Rep: 
|
You can use secure copy are rsync to copy the file instead of ftp .FTP tranfer data unencrypt format .Its always safe to transfer file using secure copy protocol (scp)
scp /home/linux1/public_html/* root@linux2.com:/home/linux2/public_html
|
|
|
11-23-2012, 10:45 PM
|
#5
|
LQ Newbie
Registered: Nov 2012
Posts: 8
Original Poster
Rep: 
|
it's not working , i get :
cp: omitting directory `cgi-bin'
cp: omitting directory `wp-admin'
cp: omitting directory `wp-content'
cp: omitting directory `wp-includes'
i go in /home/user/public_html/ and do :
scp * /home/user2/public_html/
Thank you.
|
|
|
11-23-2012, 11:05 PM
|
#6
|
Member
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Rep: 
|
Quote:
it's not working , i get :
cp: omitting directory `cgi-bin'
cp: omitting directory `wp-admin'
cp: omitting directory `wp-content'
cp: omitting directory `wp-includes'
|
Its seems to be permission problem .Whether you are trying to copy the files using root user are normal user ? Try with root user ..
ls -al /home/linux1/public_html/* -Check the permission
|
|
|
11-23-2012, 11:09 PM
|
#7
|
LQ Newbie
Registered: Nov 2012
Posts: 8
Original Poster
Rep: 
|
i got :
linux1 - nobody
linux1 -linuux1
linux1 -linux1
linux1 -linux1
linux1 -linux1
linux1 -linux1
how i change this to linux2 permision after i copy and how i copy ? thank you
|
|
|
11-23-2012, 11:20 PM
|
#8
|
Member
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Rep: 
|
Post the o/p Linux 1 machine .
ls -al /home/linux1/public_html/* -Check the permission
After sucessfully copied from Linux 1 to linux 2
You can change permission using command
chmod 755
4 = read (r)
2 = write (w)
1 = execute (x)
Last edited by jsaravana87; 11-23-2012 at 11:24 PM.
|
|
|
11-23-2012, 11:24 PM
|
#9
|
LQ Newbie
Registered: Nov 2012
Posts: 8
Original Poster
Rep: 
|
I sitll don't understad, sorry but i am beginner .
Logged as root how i can copy all files from user1 public_html folder to user2 in public_html folder and keep it working without getting internal server error.
I understand that is something about permision, also that when i download via ftp in local computer from user1 and reupload to user2 it's working because files are unedited.
Thank you
|
|
|
11-24-2012, 12:24 AM
|
#10
|
Member
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Rep: 
|
Quote:
Logged as root how i can copy all files from user1 public_html folder to user2 in public_html folder and keep it working without getting internal server error.
|
ROOT is the administrator account . root has priviledge and control of executing all commands .
|
|
|
11-24-2012, 09:11 AM
|
#11
|
LQ Newbie
Registered: Nov 2012
Posts: 8
Original Poster
Rep: 
|
I still didn'tunderstandhow to copy files and folders from one sure to new one and make it work without get internal server error..
|
|
|
11-24-2012, 11:43 PM
|
#12
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
Quote:
Originally Posted by pavdima
I sitll don't understad, sorry but i am beginner .
Logged as root how i can copy all files from user1 public_html folder to user2 in public_html folder and keep it working without getting internal server error.
I understand that is something about permision, also that when i download via ftp in local computer from user1 and reupload to user2 it's working because files are unedited.
Thank you
|
the reason why i asked you the name of the user you are using to ftp is so that you would realize that the owner of the files is not what you expect. as an experiment you can copy those files using both methods then use 'ls -l' to see the security settings/owner of those files.
Last edited by schneidz; 11-24-2012 at 11:51 PM.
|
|
|
11-24-2012, 11:45 PM
|
#13
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
Quote:
Originally Posted by arun5002
Its seems to be permission problem .Whether you are trying to copy the files using root user are normal user ? Try with root user ..
ls -al /home/linux1/public_html/* -Check the permission
|
cp and scp by default omit directories. if you want to do a recursive copy you should use the '-r' flag.
Last edited by schneidz; 11-24-2012 at 11:51 PM.
|
|
|
11-25-2012, 07:47 AM
|
#14
|
LQ Newbie
Registered: Nov 2012
Posts: 8
Original Poster
Rep: 
|
i do cp -r and tryed also cp -rp ( recursive permision ) and still get internal server error, by downloading and reuploading via fgtp is working .
waiting for more opinions , thank you
|
|
|
11-25-2012, 08:45 AM
|
#15
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
Quote:
Originally Posted by pavdima
i do cp -r and tryed also cp -rp ( recursive permision ) and still get internal server error, by downloading and reuploading via fgtp is working .
waiting for more opinions , thank you
|
using cp you are copying files as the user that issued the command (use the ls -l and chmod/chown/chgrp to view/edit the permissions to whatever you want).
by using ftp, you are logging in as the user you specified so when you create files the owner is set to the creator of each file.
Last edited by schneidz; 11-25-2012 at 08:47 AM.
|
|
|
All times are GMT -5. The time now is 12:49 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|