Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

unRAID possible to self-wake up to do a routine Parity Check

Featured Replies

Is it possible to have unraid make it wake itself up to do a routine parity check? For example, every 1st day of the month at 4am?

Is it possible to have unraid make it wake itself up to do a routine parity check? For example, every 1st day of the month at 4am?

Some BIOS will let you schedule a wake-up time. (not sure if they will do it on a specific day of the month, but probably will do it daily) As far as I know, no Operating system command can do it.

 

If awake, you can have the server schedule a check of parity on the first of the month via an add-on cron entry.

  • Author

OK, so only via a BIOS wake command it is possible. I kind of figured it wasn't possible. The server would need to be triggered a wake up command only via a hardware device or BIOS. Thanks.

OK, so only via a BIOS wake command it is possible. I kind of figured it wasn't possible. The server would need to be triggered a wake up command only via a hardware device or BIOS. Thanks.

Some BIOS can be set to wake on a "ring" event from a serial port (as if a modem was answering a phone line)

You might be able, if you were a hardware type, to put the correct signal on one of the serial port connector leads by a external timer.  Then, it could wake the server.

 

You could always set the bios to power up every day at 3:50 AM, and set a cron task to powerdown at 4:AM on every day but the first of the month.  Set another task for the 1st of the month to do the parity check.

 

  • Author

I think I might just schedule my downloads PC 'which is on 24/7' to send a magic packet to wake up my server at a certain time and day of the month, ie: 4am on the 1st of every month, and have the cron schedules parity check run five mins after it has woken up. Thanks for the suggestion Joe L.

I think I might just schedule my downloads PC 'which is on 24/7' to send a magic packet to wake up my server at a certain time and day of the month, ie: 4am on the 1st of every month, and have the cron schedules parity check run five mins after it has woken up. Thanks for the suggestion Joe L.

That will certainly work.
  • Author

Alright, could you advise on where on the forum and/or how to schedule the parity check via cron using the go script? Thanks Joe L.

Alright, could you advise on where on the forum and/or how to schedule the parity check via cron using the go script? Thanks Joe L.

 

The unRAID wiki is you friend!!  There is an entry here that will get you started in the right direction!

  • Author

I've just been reading through it, very thoughtful. Referring to the link below

 

http://lime-technology.com/forum/index.php?topic=4333.msg38885#msg38885

 

I'd imagine it is just a matter of downloading and copying the 'monthly_parity_check.sh' file to a location ie: /boot/config, make sure it has executable access, and in the 'go' script set a cron job to run it at a certain time and date? Sorry for the constant questions. Thanks.

 

 

I've just been reading through it, very thoughtful. Referring to the link below

 

http://lime-technology.com/forum/index.php?topic=4333.msg38885#msg38885

 

I'd imagine it is just a matter of downloading and copying the 'monthly_parity_check.sh' file to a location ie: /boot/config, make sure it has executable access, and in the 'go' script set a cron job to run it at a certain time and date? Sorry for the constant questions. Thanks.

 

That zip file will actually do most of that stuff for you.  All you really need to do is add a line to your go script to execute the .sh file.

  • Author

OK, so I've downloaded the *.sh file for the monthly parity checks, and this is how I've amended it to run a monthly check at 2am on the 1st day of every month:

 

 

#!/bin/sh

crontab -l >/tmp/crontab

grep -q "/root/mdcmd check" /tmp/crontab 1>/dev/null 2>&1

if [ "$?" = "1" ]

then

    echo "# check parity on the first of every month at 2am:" >>/tmp/crontab

    echo "0 2 1 * * /root/mdcmd check 1>/dev/null 2>&1" >>/tmp/crontab

    cp /tmp/crontab /var/spool/cron/crontabs/root-

    crontab /tmp/crontab

fi

 

 

and below is my 'go' script:

 

 

#!/bin/bash

# Start the Management Utility

/usr/local/sbin/emhttp &

sleep 30

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

nohup awk -W re-interval -f listen.awk >/dev/null 2>&1 &

CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz

sysctl -w kernel.poweroff_cmd="/sbin/powerdown"

#echo "powerdown" | at 23:59

ethtool -s eth0 wol g

/boot/config/mpc.sh

/boot/config/s3.sh

 

I've evoked the mpc.sh (aka monthly_parity_check.sh) before the s3.sh script. I've blanked out the scheduled powerdown command so the server only powers down after the disks have spun down and not at 12am every night. Finally, I've created Windows Schedule on my downloads PC to run a magic packet to my server's NIC at 1:55am, giving it a 5 mins to be ready for it's monthly parity check. Does this seems correct?

 

 

 

  • 1 month later...

 

  unraided;

  If I wanted to use this, how do I, and where does it go? I would need to change the times, as I work nights, and sometimes watch a movie when I get home at 4:15AM

I am not sure how to implement the sleep and wake up either. Any help would be greatly appreciated.

 

OK, so I've downloaded the *.sh file for the monthly parity checks, and this is how I've amended it to run a monthly check at 2am on the 1st day of every month:

 

 

#!/bin/sh

crontab -l >/tmp/crontab

grep -q "/root/mdcmd check" /tmp/crontab 1>/dev/null 2>&1

if [ "$?" = "1" ]

then

    echo "# check parity on the first of every month at 2am:" >>/tmp/crontab

    echo "0 2 1 * * /root/mdcmd check 1>/dev/null 2>&1" >>/tmp/crontab

    cp /tmp/crontab /var/spool/cron/crontabs/root-

    crontab /tmp/crontab

fi

 

 

and below is my 'go' script:

 

 

#!/bin/bash

# Start the Management Utility

/usr/local/sbin/emhttp &

sleep 30

for i in /dev/md*

do

    blockdev --setra 2048 $i

done

nohup awk -W re-interval -f listen.awk >/dev/null 2>&1 &

CTRLALTDEL=YES LOGSAVE=30 installpkg /boot/packages/powerdown-1.02-noarch-unRAID.tgz

sysctl -w kernel.poweroff_cmd="/sbin/powerdown"

#echo "powerdown" | at 23:59

ethtool -s eth0 wol g

/boot/config/mpc.sh

/boot/config/s3.sh

 

I've evoked the mpc.sh (aka monthly_parity_check.sh) before the s3.sh script. I've blanked out the scheduled powerdown command so the server only powers down after the disks have spun down and not at 12am every night. Finally, I've created Windows Schedule on my downloads PC to run a magic packet to my server's NIC at 1:55am, giving it a 5 mins to be ready for it's monthly parity check. Does this seems correct?

 

 

 

  • Author

- To have your unraid server power on at a certain time, you could either configure BIOS to power on your rig at a certain time and/or day/date(s). If such an option doesn't exist in your BIOS, you could enable for a magic packet (Wake On LAN packet) to be set from a host PC you your server at a particular time.

 

- To have your unraid server power off (not suspend or shut down) at a certain time, you can place the 'echo "powerdown" | at 23:59' for example, if you want to power off your server at say 6am, you'd write it like this 'echo "powerdown" | at 06:00'. Place this into the bottom of your 'go' script (located under /boot/config/go) to gracefully power down your unraid server.

Note: You must have the powerdown addon installed, see link this thread 'http://lime-technology.com/wiki/index.php?title=UnRAID_Add_Ons#Power_Down' on how to install it.

 

- To have your unraid server fall asleep at a certain time when all of your disks have gone to sleep, you'll need to create a script file and have this execute on your 'go' file upon your server starting up. See the thread link below:

 

http://lime-technology.com/forum/index.php?topic=3657.msg51739#msg51739

 

- To have your unraid server power off on command on a Windows-based PC, read the thread link below on creating Visual Basic script on a Windows machine to connect to the server and issue a 'powerdown' command. Again, this is dependent of the 'powerdown' addon, which must been installed first:

 

http://lime-technology.com/forum/index.php?topic=5534.msg51896#msg51896

 

 

For any text editing on your unraid, I'd suggest that you use the 'mc' command. It is a File Browser/Text Editor which writes script files and other text files in a proper format/order to allow them to be executed without problems.

 

Hope this helps MikeL.

 

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.