Find the answer to your Linux question:
Results 1 to 5 of 5
hello everyone, i have a problem finding the right solution for my problem, maybe someone can help me here. i got a headless server which should, when i plug in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3

    Automatically Mount USB Device, Execute Script (headless server)


    hello everyone,

    i have a problem finding the right solution for my problem, maybe someone can help me here.

    i got a headless server which should, when i plug in a usb stick/device, automatically mount it and execute a script (the script is located on the usb stick).

    actually i'm talking about auto-mount & auto-run which is already present in desktop systems but not in server systems. until now i had manually mounted the usb stick via ssh connection and then executed the script by hand. but there must me some kind of solution for this.

    is there a tool which can help me out or anything like that?

  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    maybe just set up a cronjob that checks if the usb stick is mounted and if so checks if the usb stick contains the script and if so executes it. automounting an usb stick can be achieved using autofs or plain fstab entries with the option auto.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3
    Quote Originally Posted by Kloschüssel View Post
    maybe just set up a cronjob that checks if the usb stick is mounted and if so checks if the usb stick contains the script and if so executes it. automounting an usb stick can be achieved using autofs or plain fstab entries with the option auto.
    well, thx.. i already thought about the cron job entry.. waiting for the usb stick.. but isn't there a more elegant way... a cron job seems more like a workaround than a real solution.

    i'll try the fstab entry with auto option first, if this fails, i'll give autofs a try

  4. #4
    Just Joined!
    Join Date
    Sep 2006
    Location
    Puerto Rico
    Posts
    1

    Useful link

    Check this...
    ubuntuforums.org / archive / index.php / t-502864.html

  5. #5
    Just Joined!
    Join Date
    Jul 2010
    Posts
    3
    Quote Originally Posted by Elvci02 View Post
    Check this...
    ubuntuforums.org / archive / index.php / t-502864.html
    thx buddy, i guess this will help me out.

Posting Permissions

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