[Guide] RTCwake to turn off/on your nas at a specific time

  • ok, I think I have success (ie OMV powered up this morning :) )


    Basically, I changed this line:

    Code
    rtcwake -m no -l -t $(date -d "$NEXTDAY ${START_AT_DAY[$FUNC_DATE]}") +%s


    To this:

    Code
    rtcwake -m no -a -t $(date '+%s' -d "$NEXTDAY ${START_AT_DAY[$FUNC_DATE]}")


    Changing "-l" to "-a" was necessary because my OMV uses UTC time rather than Local Time... "-a" = "auto" - It reads the HWCLOCK setting, so it should work for anyone ;)


    I also moved the "%s" string to match my testing... and that was basically all I needed to do.


    I'll test it some more, but it would appear to be working (for me)!


    Thank you! :)

  • So far, this has been working fine for the last few days, so thanks again :)


    I just had a thought though...


    Would this work to wake the PC multiple times per day?


    (I've not even attempted to test it, just thought I'd be lazy and ask.. ;) )


    It occurred to me that I use the NAS for a few hours in the morning, perhaps lunchtime (swap some MP3s with my MP3 player...) and then again in the evening (watching films), so I could use this with AutoShutdown to save even more electricity :)


    If I get around to it I'll just try putting the additional times in the config file it and see what happens :shock:

  • Hello
    i ve here a script to wake-up the server before a recordings starts (see code).


    problem is, that the server should also wakeup at 5.00 am (every day) for my server backups,
    the script below works well, but overwrite my backup-time. the script is for tvheadend.
    perhaps anyone can help me, that the server wake up before a recording starts and
    wake up at 5.00...


    My wake up code for backups:

    Code
    rtcwake -m no -t $(date -d 'tomorrow 04:58' +%s)


    Server:
    BitFenix Phenom M - ASRock B75 Pro3-M - 8GB Crucial B.S. - Intel G2140 - Corsair CX430M - 1x 64GB SanDisk SDSSDP (system) - 2x 2TB WD20EARX (data) - 1x 3TB WD30EFRX (Snapraid) - TBS6981 DVB-S2 - OMV 0.5x

  • Hi there, I have written a small plugin from which you can flexibly schedule wake up events using a cron-like syntax. The GUI is based off the default OMV crontab plugin. It makes it really easy to make sure the server is up and running for specific cron jobs. Big thanks to Ryecoaaron for creating a Krazilec package for it. He also made the source code is available on: https://github.com/OpenMediaVa…/openmediavault-wakealarm The plugin currently has the alpha status. I encourage Python coders to review the code of the script /usr/sbin/wakealarm. My coding experience is rather tiny, but I really think the plugin has a good basis.

  • hello everybody


    I am very new to OMV (installed it over the weekend) and a complete noob with Linux, so please bear with me.


    I have tried the rtcwake comand (only mode mem does something to my machine) but it does not work as intended
    more specifically:
    1. I send the comand, the machine enters stand-by (I can see this because the power button no longer illuminates and the screen goes blank)
    2. after the set no. of seconds, the power comes back but the machine never comes out of the sleep state
    3. it will not load OMV not even after I press the shutdown button, although the machine powers down when I do this
    4. In order to get it up and running again I need to pull the plug and plug it back in, after that press power


    I am using an old Sony Vaio for my NAS, model VPCYB3V1E


    any help is appreciated


    also, another 2 problems:
    - server shuts down with no reason
    - I can no longer acces the plugin and updates in the Web GUI


    this is the error when I try the plugins "Failed to execute command 'export LANG=C; apt-cache search openmediavault-':"


    but the funny thing is that yesterday it worked, since I managed to install the transmission plugin from OMV-extras repository


    thank you

  • Can you execute the quoted command via SSH on your system?


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Hi David,


    as I said I am a complete novice with Linux, so much so that I am having difficulties understanding even the most basic basics.


    so to answer your question, I assume that yes, I can send this command via SSH (I have enabled the SSH service in the web GUI and then I used putty to connect to the machine - is that what "executing via SSH" means?)


    I have tried both via putty and from the machine's keyboard, with the same result as described


    thanks

  • Yes, exactly. Type the following command into your PuTTY window, while beeing logged in as the user 'root':


    Code
    export LANG=C; apt-cache search openmediavault-


    The post the output here, you can copy paste in putty if you mark text in it with your left mouse (copy) and can paste to it with a simple rightclick.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • when I send that code via putty I get the reply: "Segmentation fault"
    same happens from the console


    edit: do I need to re-install? I have the system on an USB (obviously) and I'm thinking it is already showing signs of faults
    by the way: if I reinstall, will I be able to use the file system already created on the drive with the previous install?


    and 2. it is not possible to run OMV from a partition on the harddisk-is that correct? what about a CF card - would that be better than an USB? I really don't want to buy a harddisk just for the 2-3 Gb os pace that OMV requires, so I'm curious how you guys have it set up


    thank you

  • Get rid of your USB Stick. Its toast. Do not try to clone it, as it will screw your new installation which you better do on something that either is spinning at 5 to 7000 rpm or supports wear leveling.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Zitat von "davidh2k"

    Get rid of your USB Stick. Its toast. Do not try to clone it, as it will screw your new installation which you better do on something that either is spinning at 5 to 7000 rpm or supports wear leveling.


    Greetings
    David


    To be more precise, you only want to use USB-sticks which support static wear leveling. Most USB-sticks featuring wear leveling, only support dynamic wear leveling. It sounds more advanced, but it actually is not. :roll: For more information: http://en.wikipedia.org/wiki/Wear_leveling

  • thank you.
    any recommendations for such USB stick with static wear leveling?
    if I'm not mistaken, this kind of information is usually not available in the product specs


    is it typically used in SSDs, I see

  • Zitat von "Humbert"

    thank you.
    any recommendations for such USB stick with static wear leveling?
    if I'm not mistaken, this kind of information is usually not available in the product specs


    is it typically used in SSDs, I see


    I am personally using some re-purposed sticks on where Autodesk products are released on, in my case Product Design Suite. I found out it supports static wear leveling from the datasheet of the controller chip. :ugeek: For more information: http://whatrevitwants.blogspot…utodesk-usb-media_20.html
    Maybe you can find drives using the same controller chips. You should look for the more expensive drives. I would not be too surprised if manufacturers mention it in their product specifications, since it is a unique selling point. It would be foolish to not mention it, in my humble opinion. :roll:

  • ok guys, please help


    I reinstalled OMV on a harddisk that is connected via USB to the machine.
    all's well except that now I no longer see the folders I had previously created in the previous install of OMV
    I see the drive, I have mounted it, I see that it is a certain % full, but I do not know how to re-share the previously created folders


    so, how to do that?


    by the way: the rtcwake command now seems to work as intended with the mode = disk
    which is really nice :))


    but now I have this other problem with the files

  • sure, but the problem is that I do not see any of my previously created folders when I try to create a new shared folder
    (I think I understand the differente between creating shared folders and sharing those folders in the SMB/CIF service)


    which is really weird, since in the previous install I was able to mount and share a drive which was not even formatted in Linux, but in Windows, so I expected that sharing folders on a drive with a file system created in Linux would be a walk in the park


    LE: sorry, it looks like yesterday night I was more tired than I thought as I managed to do this today with no issues
    cheers

  • Hi I'm new and I would like to have 2 opinions if possible on the automatic switching on and off through the scheduled jobs.

    If I want to turn on the nas at 17.00 and turn it off at 3.00 what code should I use?

    Because I have found alone


    rtcwake -m off -s 43200

    I saw that it turns on at 12.00 and turns off at 0.00


    Do you have any suggestions?

    • Offizieller Beitrag

    rtcwake -m off -t $(date -d "today 17:00" +%s)


    run as scheduled job at 3:00 and the server will shut down immediately and reboot at 17:00 the same day (I hope ;) )

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!