Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
SSH CP is omitting a file
Old 02-04-2010, 01:22 PM SSH CP is omitting a file
Experienced Talker

Posts: 49
Trades: 0
trying to run a simple command...

from the directory /home/dime3/public_html/vox

Code:
cp admin /home/dime3/public_html/vtec/mrdd
returns the error

cp: omitting directory `admin/'

any idea how I can fix it?
dimensio is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-04-2010, 01:29 PM Re: SSH CP is omitting a file
Experienced Talker

Posts: 49
Trades: 0
fixed. used cp -r

and it worked.
dimensio is offline
Reply With Quote
View Public Profile
 
Old 02-04-2010, 05:07 PM Re: SSH CP is omitting a file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
or "cp -a", which copy the ownership and permissions too.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-05-2010, 03:34 PM Re: SSH CP is omitting a file
Experienced Talker

Posts: 49
Trades: 0
Ok so I updated some files in my original source directory and now want to update my main directory.

So I figured I could just copy overwriting the old files choosing to automatically overwrite.

its not working though.

tried

cp -R -f admin /home/dime3/public_html/vtec/mrdd
also tried

cp -f -R admin /home/dime3/public_html/vtec/mrdd
and

cp -R --force admin /home/dime3/public_html/vtec/mrdd
But I am still getting prompts to overwrite ! ! ! ! I have almost 10,000 files in that folder. I cant really sit here pressing Y then Enter.

any ideas why this isn't working?
dimensio is offline
Reply With Quote
View Public Profile
 
Old 02-05-2010, 03:53 PM Re: SSH CP is omitting a file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
probably because the files in that directory are tied to another user than the one of your session.

It often is the case if you have handled those files via FTP.
The ftp user is not the same than the shell user.

Check that, with a "ls -lah" on the files in that folder, and the result if "id".
"id" will give you the username and id and the main group name and id of your user.
"ls -lah" will show you the name and group of the files.

For example:
Code:
tmo@NAS:~$ id
uid=1000(tmo) gid=407(webdev) groups=7(lp),9(kmem),10(wheel),18(audio),19(cdrom),27(video),35(games),70(postgres),80(cdrw),85(usb),100(users),407(webdev),1004(plugdev),1010(vboxusers),1011(scanner),1013(uinput),1014(tuntap),1022(realtime),1023(pulse-access),1024(pulse),1029(svnusers)
This tells me that I am logged with the user "tmo", and the main group is "webdev"

and this:
Code:
tmo@NAS:~$ ls -lah
-rwxr-xr-x 1 apache webdev 281 Jul 31  2008 stopVnc.sh
tells that the file stopVnc is owned by the user "apache", in the same ggroup as me.

If the user and/or group are different, and that the user or group permission don't give you write permissions to the file, you will have this prompt.

So, if you are sure of yourself, as this could means "no more ftp working", you can change the owner of the files in your directory with:
Code:
chown -R myUser:myGroup theDirectory
After that, you should not have any prompt.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-05-2010, 04:28 PM Re: SSH CP is omitting a file
Experienced Talker

Posts: 49
Trades: 0
Hi,
I am root on the server. Logged in as root.
it is a cpanel account 'dime'

I don't know what my user or group would be.

presumable root, but no idea

would it be:

47 chown -R dime.dime *
48 chown dime.nobody admin
52 /scripts/mailperm dime

because that didnt work?
dimensio is offline
Reply With Quote
View Public Profile
 
Old 02-05-2010, 05:13 PM Re: SSH CP is omitting a file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
I don't know what my user or group would be.
For that, you type the command "id" from the console, as stated previously.

And it would be:
Code:
chown -R yourUsername:yourGroup /home/dime3/public_html/vtec/mrdd
cp -r admin /home/dime3/public_html/vtec/mrdd
chown -R previousFilesUser:previousFilesGroup /home/dime3/public_html/vtec/mrdd
But I don't think you are logged as root, because the root user have every rights to do everything everywhere (usually).
So, a root user doing a copy will have priority over the user/group permissions of a file.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-05-2010, 05:39 PM Re: SSH CP is omitting a file
Experienced Talker

Posts: 49
Trades: 0
Last login: Fri Feb 5 16:43:58 2010 from <my ip>
root@server [~]# id
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(di sk),10
(wheel)
root@server [~]# chown -R root:root admin

I also tried doing the chown -r root:root admin in the new directory and the source directory.

Tried again with CP and it yet again asked me confirm overwriting when I ran
the cp -r -f admin /home/dime...

submitted a cpanel help request.
dimensio is offline
Reply With Quote
View Public Profile
 
Old 02-05-2010, 05:51 PM Re: SSH CP is omitting a file
Experienced Talker

Posts: 49
Trades: 0
fixed by cpanel help and support by using command

unalias cp

apparently alias is a bad config or something and should be undone on most systems as it doesn't do much.
dimensio is offline
Reply With Quote
View Public Profile
 
Old 02-05-2010, 06:31 PM Re: SSH CP is omitting a file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Hmmm, god knows what they did with the alias.

Alias, as you could guess, allows you to create an alias from a command.
For example, "alias grep='grep --colour=auto'" means that when you type "grep", it's in fact "grep --colour=auto" that is called.

Strange that they have remapped them.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 02-05-2010, 08:59 PM Re: SSH CP is omitting a file
Experienced Talker

Posts: 49
Trades: 0
well I have cpanel setup to latest stable build (this is not standard, standard is the next one).

The guy emailed back to my problem with
Quote:
Howdy,

This is usually an alias setup, which I have found commonly set as default on many systems.

root@server [~]# alias | grep cp\ -i
alias cp='cp -i'

You can remove this with 'unalias cp'

Best Regards,

dimensio is offline
Reply With Quote
View Public Profile
 
Old 02-05-2010, 09:01 PM Re: SSH CP is omitting a file
Experienced Talker

Posts: 49
Trades: 0
any idea what his reply means?
dimensio is offline
Reply With Quote
View Public Profile
 
Old 02-05-2010, 09:12 PM Re: SSH CP is omitting a file
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
He tells you that there is often an alias of cp as "cp -i" defined. the -i meaning "interactive", which is what you have. You must confirm every operations.

type "alias" in a shell, and look for an "cp= something" line
if it exists, type "unalias cp" and try again.

Otherwise, don't know.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to SSH CP is omitting a file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.69245 seconds with 12 queries