Kitz ADSL Broadband Information
adsl spacer  
Support this site
Home Broadband ISPs Tech Routers Wiki Forum
 
     
   Compare ISP   Rate your ISP
   Glossary   Glossary
 
Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: 1 2 3 [4]

Author Topic: Restarting DSLstats after power cut  (Read 11103 times)

burakkucat

  • Respected
  • Senior Kitizen
  • *
  • Posts: 38300
  • Over the Rainbow Bridge
    • The ELRepo Project
Re: Restarting DSLstats after power cut
« Reply #45 on: October 16, 2018, 03:30:22 PM »

. . . perhaps our good friend Burakkucat might check my homework for us?

The logic is good. Setting a ping timeout removes the wait at that point in the code. I would suggest a longer sleep period than one second . . . it really depends upon how slowly the NAS boots and subsequently becomes ready. As a starting point, I would probably sleep for 30 seconds. Another small point to consider is what should be the default action if the NAS never becomes ready? I.e. The countdown has reached zero?
Logged
:cat:  100% Linux and, previously, Unix. Co-founder of the ELRepo Project.

Please consider making a donation to support the running of this site.

Weaver

  • Senior Kitizen
  • ******
  • Posts: 11459
  • Retd s/w dev; A&A; 4x7km ADSL2 lines; Firebrick
Re: Restarting DSLstats after power cut
« Reply #46 on: October 16, 2018, 08:00:16 PM »

Learning old sh and bash right now, I am getting mixed up with all the syntax, the single square bracket trick versus the new(?) [[ ]] technology and the (( )) round bracketed evaluation syntax. It is all quite a mixture.
Logged

Westie

  • Kitizen
  • ****
  • Posts: 1596
Re: Restarting DSLstats after power cut
« Reply #47 on: October 17, 2018, 12:10:49 AM »

Another small point to consider is what should be the default action if the NAS never becomes ready? I.e. The countdown has reached zero?
In my case I wanted DSLstats to start anyway, which is why I changed exit to break, so the rest of the script runs. If the NAS is never ready I think it's better to collect data in the default location on the Pi than lose it altogether.
Logged

tiffy

  • Kitizen
  • ****
  • Posts: 1319
Re: Restarting DSLstats after power cut
« Reply #48 on: October 28, 2018, 12:12:15 PM »

This is how I set up a Pi Zero W to save DSLstats Snapshots and DataStore to a NAS. It may not be the most elegant solution, but it works for me! I have removed personally identifying info, so you will need to modify where necessary to fit your situation.
Background Info: My NAS has a folder available to all registered users, named "GoFlex Home Public".

1. On the NAS, in "GoFlex Home Public" create a folder named "DSLstats", and within that create two further folders named "DataStore" and Snapshots" respectively.

2. On the Pi create a folder to act as the local mount point for the NAS.
Code: [Select]
mkdir /home/pi/NAS
3. Create a "Credentials" file
Code: [Select]
sudo nano /home/pi/.NAScredentialsThis file has only two lines:The items in bold should be changed to the appropriate ones registered on the NAS.

4. Change the file permissions:
Code: [Select]
sudo chmod 600 /home/pi/.NAScredentials
5. Modify the file /etc/fstab (after making a backup), by appending the following line
Code: [Select]
//192.168.xxx.xxx/GoFlex\040Home\040Public/DSLstats /home/pi/NAS cifs credentials=/home/pi/.NAScredentials,sec=ntlm,vers=1.0,rw,file_mode=0777,dir_mode=0777


6. Check that the NAS is mounted correctly by fstab
Code: [Select]
sudo mount -a
7. In DSLstats>Configuration>Snapshots, change the Snapshots directory to /home/pi/NAS/DSLstats/Snapshots

8.In DSLstats>Configuration>Data Store, change the location of the data store to /home/pi/NAS/DSLstats/DataStore

9. Reboot the Pi.

I hope this helps.

Edit: Removed wrong part of path in steps 7. & 8.

Many thanks to Westie for posting this detailed explanation ref. mounting a Windows folder on a RPI.

However, I am still struggling with the command line format within the /etc/fstab file, keep getting a syntax error from the added command line when running the "sudo mount -a" command, won't mount.
Have tried many possible permutations of the command including configuring guest access to eliminate any possible username or password issues, guidance found here:
https://wiki.ubuntu.com/MountWindowsSharesPermanently

My NAS setup is:
WDMyCloud, 192.168.0.**, \Public\DSLStats\DataStore & Snapshots
Not aware that the NAS has any password requirement, assuming that the username is WDMyCloud (or use IP address)

The final objective of the exercise is to get DSLStats web upload facilities working to my NAS or Win PC hard disk which is not possible at present.

Any suggestions appreciated.
 
Logged
BT FTTP 150/30, BT Smart Hub 2

Westie

  • Kitizen
  • ****
  • Posts: 1596
Re: Restarting DSLstats after power cut
« Reply #49 on: October 28, 2018, 10:46:17 PM »

As a Linux newbie it also took me a lot of trial and error to get a mount command line that worked!

Most of the results of my searches were for different distros and couldn't be relied on - and the same was true for Raspbian Jessie and earlier.

I had to include the vers=1.0 option because the default version in Stretch didn't work with my rather old GoFlex NAS, but I have no experience of WDMyCloud.

Maybe you could document the different mount commands you have tried, together with the reported errors? That might give a clue as to what's causing it.

Good luck! I hope you get it sorted.

Logged
Pages: 1 2 3 [4]