Sponsored Content
Full Discussion: scp links! wrong permissions
Top Forums Shell Programming and Scripting scp links! wrong permissions Post 302461068 by halacil on Friday 8th of October 2010 10:58:41 AM
Old 10-08-2010
scp links! wrong permissions

I had to copy /bin from one server to another because i accidently removed /bin ... now all copied and working but some of the soft links seems to have been created as file and their permissions set to 777 by default.. how can i recopy those ones? or change their permission to be same as the source server?

see below
source server:
Code:
lrwxrwxrwx 1 root root 4 Sep 27 11:47 sh -> bash
lrwxrwxrwx 1 root root 4 Sep 27 11:47 awk -> gawk
lrwxrwxrwx 1 root root 2 Sep 27 11:47 red -> ed
lrwxrwxrwx 1 root root 4 Sep 27 11:48 fgrep -> grep
lrwxrwxrwx 1 root root 4 Sep 27 11:48 egrep -> grep
lrwxrwxrwx 1 root root 10 Sep 27 11:48 tracert -> traceroute
lrwxrwxrwx 1 root root 10 Sep 27 11:48 traceroute6 -> traceroute
lrwxrwxrwx 1 root root 10 Sep 27 11:48 tcptraceroute -> traceroute
lrwxrwxrwx 1 root root 3 Sep 27 11:48 gtar -> tar
lrwxrwxrwx 1 root root 8 Sep 27 11:48 ypdomainname -> hostname
lrwxrwxrwx 1 root root 8 Sep 27 11:48 nisdomainname -> hostname
lrwxrwxrwx 1 root root 8 Sep 27 11:48 domainname -> hostname
lrwxrwxrwx 1 root root 8 Sep 27 11:48 dnsdomainname -> hostname
lrwxrwxrwx 1 root root 2 Sep 27 11:48 view -> vi
lrwxrwxrwx 1 root root 2 Sep 27 11:48 rview -> vi
lrwxrwxrwx 1 root root 2 Sep 27 11:48 rvi -> vi
lrwxrwxrwx 1 root root 2 Sep 27 11:48 ex -> vi
lrwxrwxrwx 1 root root 4 Sep 27 11:49 csh -> tcsh
lrwxrwxrwx 1 root root 21 Sep 27 11:50 ksh -> /etc/alternatives/ksh
lrwxrwxrwx 1 root root 4 Sep 27 11:51 mailx -> mail
[oracle@node01 bin]$ ls -ltr | grep vi
-rwxr-xr-x 1 root root 632912 Jun 12 2009 vi
lrwxrwxrwx 1 root root 2 Sep 27 11:48 view -> vi
lrwxrwxrwx 1 root root 2 Sep 27 11:48 rview -> vi
lrwxrwxrwx 1 root root 2 Sep 27 11:48 rvi -> vi
lrwxrwxrwx 1 root root 2 Sep 27 11:48 ex -> vi

target server:
Code:
[oracle@node02 bin]$ ls -ltr | grep vi
-rwxrwxrwx 1 root root 632912 Oct 5 11:52 rview
-rwxrwxrwx 1 root root 632912 Oct 5 11:52 view
-rwxr-xr-x 1 root root 632912 Oct 5 11:52 vi
-rwxrwxrwx 1 root root 632912 Oct 5 11:52 rvi
[oracle@node02 bin]$ ls -ltr | grep mail
-rwxr-xr-x 1 root root 84856 Oct 5 11:52 mail
-rwxrwxrwx 1 root root 84856 Oct 5 11:52 mailx
[oracle@node02 bin]$


Moderator's Comments:
Mod Comment Use code tags!
 

8 More Discussions You Might Find Interesting

1. Solaris

SCP from one solaris box to another without copying links

I am doing a scp (directory)from one solaris box to another.The problem is that all links present in that directory also get copied .I do not want the links to get copied .currently I am using following syntax scp -rvp pcserver info@appudemo.sea.us.wam.net:/home/info I checked the man... (1 Reply)
Discussion started by: u449064
1 Replies

2. UNIX for Advanced & Expert Users

About links

why directory has two links as default. what's the purpose? (1 Reply)
Discussion started by: nagalenoj
1 Replies

3. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

4. Debian

scp not preserving properties and links

I'm trying to get a number of old disks on HP-UX 10.2 copied over to a new Debian machine which has a NAS on it. The HP does not have rsync, but does have scp. Scp unfortunately does not always preserve permissions, and does not save links which were on the disk. Apparently rsync has a flag... (3 Replies)
Discussion started by: PasadenaDave
3 Replies

5. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

6. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

7. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

8. Shell Programming and Scripting

Why result is wrong here ? whether break statement is wrong ?

Hi ! all I am just trying to check range in my datafile pls tell me why its resulting wrong admin@IEEE:~/Desktop$ cat test.txt 0 28.4 5 28.4 10 28.4 15 28.5 20 28.5 25 28.6 30 28.6 35 28.7 40 28.7 45 28.7 50 28.8 55 28.8 60 28.8 65 28.1... (2 Replies)
Discussion started by: Akshay Hegde
2 Replies
root_archive(1M)														  root_archive(1M)

NAME
root_archive - manage bootable miniroot archives SYNOPSIS
/boot/solaris/bin/root_archive pack archive root /boot/solaris/bin/root_archive unpack archive root /boot/solaris/bin/root_archive packmedia solaris_image root /boot/solaris/bin/root_archive unpackmedia solaris_image root The root_archive utility is used to manage bootable miniroot archives and is currently only available on platforms. The utility can pack and unpack boot/root archives in both ufs and hsfs (iso9660) format. It will always generate ufs archives. root_archive also uses the lofi file driver to export a file as a block device (see lofi(7D)) and mount to mount or unmount file systems and remote resources (see mount(1M)). root_archive requires the same privileges that are needed to run these commands. SUBCOMMANDS
The root_archive command has the following subcommands: pack archive root Pack from the image found under the root directory to the archive. unpack archive root Unpack from the archive to an unpacked image under the root directory. packmedia solaris_image root Pack the solaris image to the root directory. unpackmedia solaris_image root Unpack the solaris image from the root directory. For packmedia and unpackmedia, other items that do not go into the ramdisk image are copied or uncopied (see cpio(1)) as well. Specifi- cally, this includes all the packaging databases needed for pkgadd and the other packaging utilities to succeed which are not used in the running and hence pruned to conserve memory. EXAMPLES
Example 1: Unpacking the Solaris x86 install image The following command unpacks the current Solaris image from the root directory: # root_archive unpackmedia /export/nv/solarisdvd.nvx_dvd/latest /export/Boot Where /export/nv/solarisdvd.nvx_dvd/latest represents a path to a Solaris x86 install image and /export/Boot is a directory that will be purged or created, as necessary. Example 2: Packing the Solaris x86 install image The following command packs the current Solaris image to the root directory: # root_archive packmedia /export/nv/solarisdvd.nvx_dvd/latest /export/Boot The following exit values are returned: 0 The command completed successfully. 1 The command exited due to an error. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ cpio(1), bootadm(1M), mount(1M), attributes(5), lofi(7D) 26 Sep 2005 root_archive(1M)
All times are GMT -4. The time now is 04:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy