I'm looking for a way to mirror one user to another.
For example:
If I have the user ABC and I want to mirror his:
-Primary group
-Any other groups ABC belongs to
-UID
-Home directory
And create an exact copy over to another server to a user called XYZ. I already have SSH keys set up, don't worry about that, and I have the bulk of the code already .. but..
I'm having trouble writing the bit where it's like:
If
- the user already exists, just use usermod to change XYZ attributes with all of ABC's info.
else
- the user doesn't exist, use useradd to create the account XYZ with all of ABC's info.
How do I write a statement that will execute that whole block of code, or different block of code. Should I put usermod command and the useradd command as a function and just do something like
if x
then usermod
else
useradd
But how do I determine if the user already has an account?
Putting usermod and useradd as functions looks more well arranged to me, and to determine whether the user has an account, execute "grep $user-name /etc/passwd";
for example, if I run this from my box :
would return :
Quote:
sysgate:x:500:500:My Real Name:/home/sysgate:/bin/bash
, having in mind that ${USERNAME} is preset within my "env"
Hello Team,
In one of our machine which running in AIX 6.1 we doing the root mirroring. Currently the OS booted from the local disk and we have mirrored that in to the SAN disk. All went well and both are synced but when we making it as a multiboot its throwing the below error. Kindly... (4 Replies)
Hi All
Please can I have some help/advice.
I am fairly new to unix so any help will be useful.
I need to perform HDD Mirroring on a Sun Fire V245 Server running Solaris 10 OS.
The system is already up and running and has the partitions and slices already.
Is it possible to perform the... (6 Replies)
Hi All
i wish to mirror the root disk, but i face the below error.
root@saturn # metainit d11 1 1 c0t0d0s0
metainit: saturn: c0t0d0s0: is mounted on /
kindly assist... (27 Replies)
Hi,
I'm trying to setup mirroring, but i get an error.
what have done is.
prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
Then i created the metadb.
metadb -a -f c1t0d0s7 c1t1d0s7
now i wan't to metainit.
metainit -f d11 1 1 c1t0d0s0
metainit -f d12 1 1... (4 Replies)
hi every body
I'm new to solaris and I need your help in how to configure disk mirroring for 4 hard disks so that two of them will be replica to the other two ...???
Thanxx (7 Replies)
Unix is something new for me, I trying learn about it now.
I have download the sun virtualbox software and install solaris 10 into it. It is is like wizard with step by step installation guideline. :)
NOw how can i implement mirroring(RAID) into the my new SunOS? can anyone give a briefly list... (14 Replies)