Find the answer to your Linux question:
Results 1 to 3 of 3
To start I am and intermediate Linux user. And a beginner when it comes to scripting. I work with Linux all day at work and I am learning a lot ...
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    5

    How can I change users shile a script is running

    To start I am and intermediate Linux user. And a beginner when it comes to scripting.

    I work with Linux all day at work and I am learning a lot but I am stumped. Recently i have been handed a project of proactively replacing a few thousand Server drives.

    I walk the customer though installing the existing server in the backup location and installing a new server in the primary location. ie hdc and hda locations.

    I am trying to put all the commands and some extras into one script.
    There are a few areas which require me to log out of root and then log back in as root.

    Can I automate this in my script. Ideally I would like this to become more easier with just 1 command. ie ./restore or something of that nature.

    Also can I have the script check which drives are mounted and proceed depending on the results. ie If the hdc is already mounted.... stop.

    Thank You all for any advice you have.

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,097
    sudo comes to mind.
    But that would mean, you need to deploy an appropiate sudo config on all the servers beforehand. Is that a possibility?
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Nov 2009
    Posts
    5
    Unfortunately that is not possible. I was going to attempt that but sudo is not recognized as a command. Just su.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...