My Cloud Sleep with Ubuntu (Linux)?

Hi, I have a pi2 running Ubuntu with Plex Media Server. I have my My Cloud shares “mounted”. I also have Transmission open in the background with torrents waiting to download onto the My Cloud at specific times.

I have noticed that my My Cloud doesn’t seem to sleep when the pi is connected. Could that be why ? Does anyone actually use Linux with the shares “mapped/mounted” and their My Cloud sleeps or not ?

Also, is there an easy way I can check when and if the My Cloud sleeps and wakes in a Log file perhaps ?

Thanks

There are entries in the /var/log/user.log Showing when the device sleeps and wakes up. create a file called sleep.awk of the following code.
awk ’
NR==1 { a=substr($1,6,2); b=substr($1,9,2); c=substr($1,12,8) }
{if ($7 ~ /after/){
hh1=int($8/3600)
mm1=int(($8%3600)/60)
ss1=($8%3600)%60
Total = Total + $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(Total/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 “/2015 " c
end= substr($1,6,2) “/” substr($1,9,2) “/2015 " substr($1,12,8)
$1=start
#print start " " end
cmd=“date --date=””$1"” +%s"
#print cmd
cmd|getline st
printf “Start %s\n” ,st
$1=end
cmd=“date --date=”"$1"" +%s"
cmd|getline end
#print cmd
printf “End %s\n” ,end
Total=end-st
hh1=int(Total/3600)
mm1=mm1=int((Total%3600)/60)
ss1=(Total%3600)%60
printf “Total Up Time: %2d:%02d:%02d\n” ,hh1,mm1,ss1
}’

create a file called sleeptime.sh with the following line
cat /var/log/user.log.1 /var/log/user.log|/nfs/George/sleep.awk

I put these files in /nfs/George. You can then just
sh sleeptime.sh

It will display the sleep times in a more readable format.

RAC

1 Like

I don’t know why those three lines are printed so large. But they should have a # as the first character.

RAC

The new forum uses punctuation characters as short-form formatting tags, so you have to use HTML tags for those symbols… Rather annoyingly…

> does a ‘quote insert’

like this

* is used for italics

** is used for bold

etc…

Hi, I don’t have a user.log file…

The file is on the My Cloud. The file does exist.

RAC

Oh…In that case I got no clue how to do any of what you said…

You would have to SSH into the My Cloud to execute those commands.

RAC

The MyCloud is a Linux box. Very like the RPi. Only it’s running a Debian distribution, rather than UBuntu.

So, if you’re familiar with Linux command line stuff on the RPi, you will be pretty at home on the MyCloud. You just have to be able to log in to the Linux command shell. Which you can do using the SSH protocol, and an SSH client, like PuTTY.

http://support.wdc.com/KnowledgeBase/answer.aspx?ID=10435

Thank you RAC for sharing this script :+1:

Unfortunately, I am not so familiar with this although I really would like to be able to check if the device sleeps at all…

So if I install Putty and enable SSH on the device, im not sure what to do next to be able to login to the My Cloud and browse the folders, create files and such…

I’m afraid it’s time to go looking for a Linux tutorial then.