We Cloud not Sleeping

Hi all

I know there has been a lot of talk about this subject, I have looked and read all day, I have tried loads of thinks but can get my cloud to sleep.

Content scan is idle, NTP service is off,Drive sleep on, SSH off, FPT Access Off,Media Streaming On, ITunes Server Off, Alert Emails On,Auto update Off. All that is in the dashboard setting.

the IPhone/ IPad I have the following settings Auto Backup photos off,analytics off , on my cloud HDD unit the activity light flashes ever 10 seconds this is what I believe is stopping the cloud from sleeping any ideas

If you haven’t see the other recent thread, below, on sleep issues you should read through that one and follow the links in it. There is no one set fix for the sleep issue.

https://community.wd.com/t/i-have-a-my-cloud-it-is-not-hibernating/170124

Have you tried the “mount -o remount,noatime,nodiratime /dev/root /” command? There has been
a issue with samba updating a file access time every 10 seconds. Can’t find the file name right now.

RAC

Thanks RAC but I don’t have no idea what your on about, could you please put it in simple terms. Thanks Paul

This thread is about MC wakeups, not that it does not hibernate. Two different stories.

Not sure what your point is. As mentioned, in the thread I linked to the question was similar to the question asked by the OP in this thread. The My Cloud not sleeping. Not everyone knows that sleep and hibernate are two different issues and the OP of the other thread appears to have used the wrong terminology.

Further my post in that other thread has several links to various other threads that discuss various methods of trying to get the My Cloud to sleep.

https://community.wd.com/t/i-have-a-my-cloud-it-is-not-hibernating/170124/7

As indicated there is no perfect fix that works 100%. While the command “mount -o remount,noatime,nodiratime /dev/root /” mentioned by Rac8006 (and in other threads on the sleep problem) is a start it is not the only thing to try. Currently the My Cloud I use will sleep for around 70% to 80% of the time after trying many of the suggestions in other threads when the device isn’t used for long periods of time.

It is a command that is run on the My Cloud after you SSH into the Cloud.

RAC

Hi I have turned on SSH can copyed the mount o mount but where do I enter this, every time I enter it into the search bar I just get web pages, and help please .

You need to SSH into the My Cloud. You will need a program like putty to login from windows.
When you login to the My Cloud. You will get a prompt. At the prompt you will enter the command.
mount -o remount,noatime,nodiratime /dev/root /

RAC

After enabling SSH within the My Cloud Dashboard one would use an SSH command line terminal program like Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) if using a Windows OS. You should perform an internet search to learn how to issue commands via the SSH command line terminal like Putty to avoid potentially bricking your My Cloud. Using SSH may void your My Cloud warrantee.

One you have logged into the My Cloud using SSH/Putty one would issue the following command from the Putty terminal command line and hit the return/enter key:

mount -o remount,noatime,nodiratime /dev/root /

For example using Putty:

If one see’s the link I posted above they will see links to several other threads that discuss various methods (most all via SSH) to turn off services or modules within the My Cloud that may improve the sleep time.

Thanks Bennor. You are more adapt at posting good picture and links.

RAC

Since this is the latest thread with respect to “sleep” that mentions the sleep.awk script, I’m asking my question here. I want to check the sleep duration of my drive as well, however I get the following:

Command:
tail /var/log/user.log|./sleep.awk

Error:
awk: cmd. line:1: Unexpected token

Script I’m running:

awk ' NR==1 { a=substr($1,6,2); b=substr($1,9,2); c=substr($1,12,8); y=substr($1,1,4)} {if ($7 ~ /after/){ hh1=int($8/3600) mm1=int(($8%3600)/60) ss1=($8%3600)%60 TotalSleep = TotalSleep + $8 printf "%2s %2s %8s %8s %5d %2d:%02d:%02d\n",substr($1,6,2),substr($1,9,2) ,substr($11,0,9),substr($1,12,8),$8 ,hh1,mm1,ss1}} END { hh1=int(TotalSleep/3600) mm1=mm1=int(($8%3600)/60) ss1=($8%3600)%60 printf "Total Sleep Time: %2d:%02d:%02d\n" ,hh1,mm1,ss1 start= a "/" b "/" y " " c "date +%Y"|getline year end= substr($1,6,2) "/" substr($1,9,2) "/" year " " substr($1,12,8) $1=start cmd="date --date=\""$1"\" +%s" cmd|getline st printf "Start %s\n" ,st $1=end cmd="date --date=\""$1"\" +%s" cmd|getline end printf "End %s\n" ,end Total=end-st hh1=int(Total/3600) mm1=mm1=int((Total%3600)/60) ss1=(Total%3600)%60 Percent=int((TotalSleep/Total)*100) WakeTime= int(100 - Percent) printf "Total Up Time: %2d:%02d:%02d %2d%% Sleep %2d%% Wake\n" ,hh1,mm1,ss1,Percent,WakeTime }'

Would be great to get inputs in the right direction.

Thanks

I might be tempted to make the awk script an actual awk script, rather than what it is at the moment, which is a shell command to run an awk script. This would involve removing that first line, and the single quote at the end of the last line, and then modifying your command line to call awk:

tail /var/log/user.log | awk -f sleep.awk

The other possibility is that your sleep.awk has DOS CR/LF line terminator pairs, depending on how you created it (copy & paste from a thread?). I can’t remember if awk is fussy about line terminators, but other aspects of Unix certainly are.

Of hand I don’t see anything wrong. I tried your command tail /var/log/user.log|./sleep.awk. It displayed correctly. Not supposed to use tail to get the sleep data. What I have is the following:
alias sl=‘sh /nfs/George/sleeptime.sh’
sleeptime.sh
//start
gunzip -c /var/log/user.log.2.gz > tmpuserlog
cat tmpuserlog /var/log/user.log.1 /var/log/user.log|/nfs/George/sleep.awk
rm tmpuserlog
//end

Create the sleeptime.sh file with what is between //start and //end
After the alias command you just need to type sl

The sleeptime.sh shell collects the data from all three user logs.

RAC

Here is how I check the sleep time. First was to create the sleep.awk file in one of my Share’s (or subfolder within a Share). Then in that same location create sleeptime.sh. To generate the time I run the sleeptime.sh from the command line using the command: sh sleeptime.sh.

sleep.awk
awk ’
NR==1 { a=substr($1,6,2); b=substr($1,9,2); c=substr($1,12,8); y=substr($1,1,4)}
{if ($7 ~ /after/){
hh1=int($8/3600)
mm1=int(($8%3600)/60)
ss1=($8%3600)%60
TotalSleep = TotalSleep + $8
printf “%2s %2s %8s %8s %5d %2d:%02d:%02d\n”,substr($1,6,2),substr($1,9,2) ,substr($11,0,9),substr($1,12,8),$8 ,hh1,mm1,ss1}}
END {
hh1=int(TotalSleep/3600)
mm1=mm1=int(($8%3600)/60)
ss1=($8%3600)%60
printf “Total Sleep Time: %2d:%02d:%02d\n” ,hh1,mm1,ss1
start= a “/” b “/” y " " c
“date +%Y”|getline year
end= substr($1,6,2) “/” substr($1,9,2) “/” year " " substr($1,12,8)
$1=start
cmd=“date --date=”"$1"" +%s"
cmd|getline st
printf “Start %s\n” ,st
$1=end
cmd=“date --date=”"$1"" +%s"
cmd|getline end
printf “End %s\n” ,end
Total=end-st
hh1=int(Total/3600)
mm1=mm1=int((Total%3600)/60)
ss1=(Total%3600)%60
Percent=int((TotalSleep/Total)*100)
WakeTime= int(100 - Percent)
printf “Total Up Time: %2d:%02d:%02d %2d%% Sleep %2d%% Wake\n” ,hh1,mm1,ss1,Percent,WakeTime
}’

sleeptime.sh
cat /var/log/user.log.1 /var/log/user.log|/nfs/[admin user name]/WD\ My\ Cloud/sleep.awk

Thanks a lot for your reply. The issue was with the way I created the sleep.awk file. I created a txt file and changed it to awk. Normally this works for php, html, etc., but didn’t work for awk.

I used “vi” command to create the file using the prompt and it worked.