Results 1 to 4 of 4

Thread: 12.04 Shutdown Script

  1. #1
    Join Date
    Nov 2007
    Beans
    101

    12.04 Shutdown Script

    Hello, hope this fits into the right place.

    So here is my issue, I've got a VM running on my Laptop that I'm using just for RAW image work,I'm taking a up a new hobby, photogrphy. I've set aside 100 GB for local file storage just for images. My intent here is to only fire this VM when I need to do any work with the images, RAW edits, imports ,uploads to the web, ect. I've got reasons for not doing it on the host, long story.

    As of right now I've set up a backup solution to include rsync and ssh to my file server via the network.

    What I'm trying to do is have rsync run at shutdown to sync changes. Since I'll only be using the VM for the images, their is little chance that I'll be running for no reason and cron isn't a feasible idea.

    I've tried putting the script in /etc/rc0.d/ to run at shutdown, with no luck. The issues are as follows...

    1) The script or rsync never finish running because the shutdown continues and eventually (if not before the script starts, the network is killed and so on)

    2) For some reason, when the script is run it doesn't locate my SSH Key and thus requires a password login to the server, Runs find from command line, I'm guessing this is because it's being run by a different user when being invoked during shutdown. Not even sure where to begin on that one.


    anyone have an ideas on how to tell shutdown to wait until this script finishes and how to ensure the shutdown execution has access to my user's ssh key?

    Thanks

    Rob

    Happy New Year

  2. #2
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,265
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 12.04 Shutdown Script

    rsync is too big a process to run at shutdown.

    Rather than telling shutdown to run and wait for rsync, I would do it the other way around. Set your backup script to run rsync and then shutdown.

    Code:
    rsync 
    sudo shutdown now
    Problems with WINE?
    Full Circle Magazine :: Confused "allot"? :: Cheap Linux stickers
    In my day, we had outdoors in which to run, play, and socialise. Now we have computers to do those.

  3. #3
    Join Date
    Nov 2007
    Beans
    101

    Re: 12.04 Shutdown Script

    I hadn't thought of it that way. I'll give that a shot.


    Any way to throw this into the shutdown button in gnome?


    Rob

  4. #4
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,265
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: 12.04 Shutdown Script

    Quote Originally Posted by rwslippey View Post
    Any way to throw this into the shutdown button in gnome?
    Probably, though I wouldn't know how. But I would avoid doing that, because it will prevent you from using the shut-down button when you may need it sometime in the future (e.g. your computer interface hangs but the shut-down button still works).

    Rather create a keyboard short-cut to your script, or a launcher icon for your mouse.
    Problems with WINE?
    Full Circle Magazine :: Confused "allot"? :: Cheap Linux stickers
    In my day, we had outdoors in which to run, play, and socialise. Now we have computers to do those.

Bookmarks

Posting Permissions

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