Difference between revisions of "Wrap-exec"

From Noah.org
Jump to navigationJump to search
(Replaced content with 'Category:Engineering <pre> #!/bin/sh </pre> Category:Engineering')
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
</pre>
 
 
== Migrate Users From Old Linux box to new Linux box =
 
 
<pre>
 
#!/bin/sh
 
 
#
 
# This script helps migrate user accounts to a new server.
 
#
 
 
IDMIN=1000
 
IDMAX=29999
 
DESTDIR=/root/migrate
 
 
if [ $(id -u) -ne 0 ]; then
 
    echo "You must be root to run this."
 
fi
 
 
mkdir -p ${DESTDIR}
 
 
awk -v VIDMIN=IDMIN -v VIDMAX=IDMAX -F: '(3VIDMIN) (3VIDMAX)'
 
cp /etc/gshadow ${DESTDIR}/gshadow.old
 
cp /etc/sudoers ${DESTDIR}/sudoers.old
 
 
tar czf ${DESTDIR}/etc.tar.gz ${DESTDIR}/*.old
 
#tar czpf ${DESTDIR}/home.tar.gz /home
 
echo "WARNING! Not including /home in the migration."
 
 
# vim:set sr et ts=4 sw=4 ft=sh: // See Vim, :help 'modeline'
 
 
</pre>
 
</pre>
  
 
[[Category:Engineering]]
 
[[Category:Engineering]]

Latest revision as of 04:27, 4 November 2009


#!/bin/sh