LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 11-23-2012, 05:00 PM   #1
pavdima
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Rep: Reputation: Disabled
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.
 
Old 11-23-2012, 05:14 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
^ 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.
 
Old 11-23-2012, 05:27 PM   #3
pavdima
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-23-2012, 10:38 PM   #4
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
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
 
Old 11-23-2012, 10:45 PM   #5
pavdima
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
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.
 
Old 11-23-2012, 11:05 PM   #6
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
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
 
Old 11-23-2012, 11:09 PM   #7
pavdima
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-23-2012, 11:20 PM   #8
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
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.
 
Old 11-23-2012, 11:24 PM   #9
pavdima
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-24-2012, 12:24 AM   #10
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
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 .
 
Old 11-24-2012, 09:11 AM   #11
pavdima
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
I still didn'tunderstandhow to copy files and folders from one sure to new one and make it work without get internal server error..
 
Old 11-24-2012, 11:43 PM   #12
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by pavdima View Post
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.
 
Old 11-24-2012, 11:45 PM   #13
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by arun5002 View Post
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.
 
Old 11-25-2012, 07:47 AM   #14
pavdima
LQ Newbie
 
Registered: Nov 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-25-2012, 08:45 AM   #15
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by pavdima View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question: command for moving contents of a directory chesterb Linux - Newbie 8 02-14-2008 09:11 AM
Stupid, stupid question; I lost Klaptop. :( Surfrider Slackware 2 08-31-2005 09:12 PM
Stupid Question - what is Linux based on? cmf5150 Linux - Newbie 11 03-11-2004 05:09 PM
Another stupid linux newbie question benny515 Linux - Software 4 08-19-2003 10:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration