Announcement

Collapse
No announcement yet.

How to copy log file to another location?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to copy log file to another location?

    I'm trying to come up with a shutdown script to copy the log file over to another location in the filesystem of my HomeTroller Zee S2 before it gets deleted.

    I thought something like this would do the trick, but it doesn't seem to be working:
    CreateObject("Scripting.FileSystemObject").FileCopy("\tmp\Ho meSeerLog.hsd","\home\homeseer\Documents\HomeSeerLog.hsd")

    BTW, I'm a noob here, so let me know if you have any tips and tricks for debugging or writing scripts in general. I'm on HS4. Thanks in advance!

    #2
    I don't use the Zee, but are you sure the log is being deleted? I would expect it to be continually pruned to keep its size within the limits you've set in the setup page, but otherwise survive a restart of HS. (In HS3, the log filter is reset to begin at the point the last session started, but the filter can be reset to view log entries prior to shutdown. I assume HS4 on the Zee is similar, but I don't know. Have you tried?)
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      Originally posted by Uncle Michael View Post
      I don't use the Zee, but are you sure the log is being deleted? I would expect it to be continually pruned to keep its size within the limits you've set in the setup page, but otherwise survive a restart of HS. (In HS3, the log filter is reset to begin at the point the last session started, but the filter can be reset to view log entries prior to shutdown. I assume HS4 on the Zee is similar, but I don't know. Have you tried?)
      It gets deleted upon reboot. Support has confirmed this is intended behavior.

      EDIT: I didn't pay attention to whether this happened on HS3 before I upgraded a couple weeks ago. Maybe it's a "feature" of HS4

      Comment


        #4
        Originally posted by viper5030 View Post

        It gets deleted upon reboot. Support has confirmed this is intended behavior.

        EDIT: I didn't pay attention to whether this happened on HS3 before I upgraded a couple weeks ago. Maybe it's a "feature" of HS4
        I'm still on HS3 and Log file is not deleted on reboot. Since the core of HS4 is same as HS3, I doubt it is being deleted on reboot--this would almost defeat it's purpose. The only deleting that should occur is when the limits you set in "Setup/General" have been exceeded(time limit or size limit). Please recheck the filter date and time setting on log page.

        Comment


          #5
          Originally posted by BobSpen View Post

          I'm still on HS3 and Log file is not deleted on reboot. Since the core of HS4 is same as HS3, I doubt it is being deleted on reboot--this would almost defeat it's purpose. The only deleting that should occur is when the limits you set in "Setup/General" have been exceeded(time limit or size limit). Please recheck the filter date and time setting on log page.
          Thanks for your input, but HS support has confirmed that this is 100% intended behavior. I'm not sure who to believe here. Yes, I'm checking filters and even the SQLite file itself -the data gets deleted every time I reboot. I agree that it sort of defeats the purpose, so I'm certainly not happy with the answer I got from support. Any further guidance you can give me from this point would be appreciated.

          Comment


            #6
            What are your settings in "Tools/Setup/General" for Log file(or wherever it is in HS4)?
            Maybe others running HS4 can comment????

            Comment


              #7
              Originally posted by BobSpen View Post
              What are your settings in "Tools/Setup/General" for Log file(or wherever it is in HS4)?
              Maybe others running HS4 can comment????
              I've set them to anything ranging from 0 to 100 MB and 1 to 14 days, no change on the behavior of the reboot.

              To make sure we're on the same page here, you're saying the Zee S2 on HS3 does not delete its log file on reboot?

              Comment


                #8
                Originally posted by viper5030 View Post

                Thanks for your input, but HS support has confirmed that this is 100% intended behavior. I'm not sure who to believe here. Yes, I'm checking filters and even the SQLite file itself -the data gets deleted every time I reboot. I agree that it sort of defeats the purpose, so I'm certainly not happy with the answer I got from support. Any further guidance you can give me from this point would be appreciated.
                I do not have a zee, but if it is configured like a z-net is - by design, then /tmp is a tempfs. In other words, ram only in that it's not actually writing to the SD card saving IO on the card and elongating card life. As tmpfs is memory, everything is lost on shutdown. You would need to copy your log file somewhere on /dev/ file system to survive a reboot.

                pi@Z-Net:~ $ df -h
                Filesystem Size Used Avail Use% Mounted on
                /dev/root 3.6G 914M 2.6G 27% /
                devtmpfs 459M 0 459M 0% /dev
                tmpfs 463M 0 463M 0% /dev/shm
                tmpfs 463M 47M 417M 11% /run
                tmpfs 463M 12K 463M 1% /run/lock
                tmpfs 463M 0 463M 0% /sys/fs/cgroup
                tmpfs 463M 0 463M 0% /var/tmp
                tmpfs 1.0M 1.0M 0 100% /var/log
                tmpfs 463M 0 463M 0% /tmp
                /dev/mmcblk0p1 63M 21M 43M 33% /boot


                Comment


                  #9
                  Originally posted by viper5030 View Post
                  I'm trying to come up with a shutdown script to copy the log file over to another location in the filesystem of my HomeTroller Zee S2 before it gets deleted.

                  I thought something like this would do the trick, but it doesn't seem to be working:
                  CreateObject("Scripting.FileSystemObject").FileCopy("\tmp\Ho meSeerLog.hsd","\home\homeseer\Documents\HomeSeerLog.hsd")

                  BTW, I'm a noob here, so let me know if you have any tips and tricks for debugging or writing scripts in general. I'm on HS4. Thanks in advance!
                  try changing your backslashes "" to forward slashes "/" and remove the space in /tmp/HomeSeerLog.hsd.... for example.....

                  CreateObject("Scripting.FileSystemObject").FileCopy("/tmp/HomeSeerLog.hsd","/home/homeseer/Documents/HomeSeerLog.hsd")

                  Comment


                    #10
                    Originally posted by lveatch View Post
                    I do not have a zee, but if it is configured like a z-net is - by design, then /tmp is a tempfs. In other words, ram only in that it's not actually writing to the SD card saving IO on the card and elongating card life. As tmpfs is memory, everything is lost on shutdown. You would need to copy your log file somewhere on /dev/ file system to survive a reboot.
                    Very interesting theory on the /tmp folder for the Zee, but when I pull the plug on it (which I know is bad), the files in the /tmp folder are preserved. So that tells me its actually some sort of non-volatile memory. Which makes it even more of a mystery why HS chooses to actively delete it on reboot.

                    Originally posted by lveatch View Post
                    try changing your backslashes "" to forward slashes "/" and remove the space in /tmp/HomeSeerLog.hsd.... for example.....
                    CreateObject("Scripting.FileSystemObject").FileCopy("/tmp/HomeSeerLog.hsd","/home/homeseer/Documents/HomeSeerLog.hsd")
                    Thanks for the suggestion, but no dice. The error I get is "Exception has been thrown by the target of an invocation."

                    I'm going to try it in C# tomorrow and will post the results.

                    Comment


                      #11
                      Originally posted by viper5030 View Post

                      I've set them to anything ranging from 0 to 100 MB and 1 to 14 days, no change on the behavior of the reboot.

                      To make sure we're on the same page here, you're saying the Zee S2 on HS3 does not delete its log file on reboot?
                      I run on a PC(Windows10) and HS3 does NOT delete Logs on reboot. Zee S2? I will leave for others to comment further.

                      Comment


                        #12
                        I have resorted to running a Python script from a server every 15 min. to write out the log file to a CSV in a network location. So when I reboot, the most I'll lose from the log files is 15 min., which is better than nothing!

                        Comment

                        Working...
                        X