Scheduled shutdown not working

I have a scheduled shutdown task - Everyday-22:00 (Control Panel > Hardware & Power > Power) that only works randomly. Anyone else with this issue? I also have a Boot task that works as expected.

1 Like

Maybe try the official forum or Ugreen support, this is an unofficial forum.

https://community.ugreen.com/nas/#/

OK, thanks for the advise - done.

1 Like

Me too.
I’m using a scripted ssh to shut it down if it running 30 mins after scheduled shutdown

That script is on my list - any chance of sharing it?

I’m embarrassed that is just one line.

bigcat@pihole02:~ $ cat halt-ug.sh
#!/bin/bash
ssh -o BatchMode=yes -o StrictHostKeyChecking=no ugadmin@192.168.10.7 “lsblk /dev/sda”

bigcat@pihole02:~ $ ./halt-ug.sh
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 14.6T 0 disk
├─sda1 8:1 0 15.3G 0 part
└─sda2 8:2 0 14.5T 0 part
└─md1 9:1 0 29.1T 0 raid5
└─ug_75C7F5_1756408054_pool1-volume1 253:0 0 29.1T 0 lvm /home
/volume1

replace lsblk /dev/sda with say “sudo halt”

I schedule the script from the local system using cron
(crontab -l 2>/dev/null; echo ‘0 2 * * * //home/dave/halt-ug.sh’) | crontab -

I’d probably put some logging - date of invocation, test that it worked

Later I might wakeonlan to wake up the NAS at 06:45
/usr/bin/wakeonlan 6C:12:34:56:78:FF # Ugreen NAS01

something like

#!/bin/bash

CRON_TMP=$(mktemp)

Keep existing crontab (if any), remove old wakeonlan entries to avoid duplicates

crontab -l 2>/dev/null | grep -v ‘wakeonlan’ > “$CRON_TMP”

Add new entries

cat <> “$CRON_TMP”
45 6 * * * /usr/bin/wakeonlan 6C:12:34:56:78:FF # Ugreen NAS01
46 6 * * * /usr/bin/wakeonlan 7C:12:34:56:78:FF # Ugreen NAS02
EOF

Install new crontab

crontab “$CRON_TMP”

Clean up

rm “$CRON_TMP”