Auto Backup
Moderator: Mattk
Auto Backup
Is there a way to do an automatic backup of the data since USB sticks tend to be unreliable... Has anyone come up with a technique......
Thanks
Thanks
Re:Auto Backup
The system is set up to use rSync to do regular backups. I use the Windows version (cwRsync) and perform the backup on a daily basis. You set up a cron schedule (or scheduled events task) on the computer where the backup will be stored, and it will do all the work for you.
The Windows version of the software is available in the Downloads > Tools section of this site, along with some basic documentation.
The Windows version of the software is available in the Downloads > Tools section of this site, along with some basic documentation.
Re:Auto Backup
Hi,
can you write an exacly description, how to create the task on windows. It would be great! Thanks so much!
can you write an exacly description, how to create the task on windows. It would be great! Thanks so much!
Re:Auto Backup
Okay, here is how I did it in very thorough detail.
This only works if you can access the Meteohub server using Windows file sharing. That means the Meteohub must be in the same workgroup (e.g. WORKGROUP) and on the same subnet (e.g. 192.168.1.x) as your computer. Assuming that is how your system is set up, then the instructions are as follows:
1) Download cwRsync from the Downloads > Tools section of this site.
2) Install the software and write down the location it is installed (e.g. c:\\cwrsync)
* Note that you can install the software in another location, but be sure to change 'c:\\cwrsync' in my instructions below to the name of the folder you created.
3) Using Windows Explorer, navigate to c:\\cwrsync\\bin and create two new folders inside called 'data' and 'config'. These are case-sensitive, to be careful to only use lower-case.
3) Open notepad and insert the following text:
@echo off
rsync.exe -uav rsync://root@Meteohub/data data
rsync.exe -uav rsync://root@Meteohub/config config
Note that "Meteohub" is the default Meteohub hostname, but if you have assigned it a different name then use that instead (on the Meteohub web control panel, this is the first line in the 'Network' section of the System Info page. The workgroup, which I mentioned at the top of this post, is the second item.) All the other, text should be exactly as typed above.
4) Save that file with the name "backup.bat" (**NOT backup.txt or backup.bat.txt!) and put it in the folder c:\\cwrsync\\bin
5) Double-click the file and run it to verify you typed the path correctly. A long line of text should scroll past in a command shell and close when finished, which will take anywhere from five minutes a half-hour depending on the amount of historical data you have on your Meteohub. Verify that the backup was successful by opening the 'data' folder (within c:\\cwrsync\\bin). It should have eight folders inside, with the most important one being 'weather'.
6) Assuming step five was successful, open your Control Panel, and select "Scheduled Tasks" or "Performance and Maintenance > Scheduled Tasks" (this varies depending on how you have items set to display in your configuration.) From here, select "add scheduled task".
7) The Scheduled Task Wizard should now be open.
7a) Click 'Next' on the first page and prepare to wait a few minutes while the computer thinks about all the things you might want it to do (it took my system about two minutes and for a while I thought I had crashed, so be patient!)
7b) A list should pop up, with lots of program names in it. Ignore the list and click the 'Browse...' button.
7c) In the window that pops up, navigate to c:\\cwrsync\\bin and select backup.bat. Click 'Open' and it should return you to the first window.
7d) Give the task a name (e.g. 'weather backup' ) and select how frequently to perform the task (I recommend either "Daily" or "When I log on". ) Click 'Next'.
7e) Assuming you picked 'Daily', assign the time to do the backup. Make sure to pick a time that you typically have the computer powered up! Click 'Next'.
7f) It will probably ask for a password and user name. Give it the same details as your normal windows login (if you don't use a password to log in, just leave this blank and click 'Next'.)
7g) A final screen will verify that you have set everything up to run the task every day. Click 'Finish' and you are done.
That's it! Your computer will now backup the Meteohub data on a daily basis, and the best part of cwRsync is that it only re-copies files that have changed since the previous backup, so all future backups should be much faster than the first one.
This only works if you can access the Meteohub server using Windows file sharing. That means the Meteohub must be in the same workgroup (e.g. WORKGROUP) and on the same subnet (e.g. 192.168.1.x) as your computer. Assuming that is how your system is set up, then the instructions are as follows:
1) Download cwRsync from the Downloads > Tools section of this site.
2) Install the software and write down the location it is installed (e.g. c:\\cwrsync)
* Note that you can install the software in another location, but be sure to change 'c:\\cwrsync' in my instructions below to the name of the folder you created.
3) Using Windows Explorer, navigate to c:\\cwrsync\\bin and create two new folders inside called 'data' and 'config'. These are case-sensitive, to be careful to only use lower-case.
3) Open notepad and insert the following text:
@echo off
rsync.exe -uav rsync://root@Meteohub/data data
rsync.exe -uav rsync://root@Meteohub/config config
Note that "Meteohub" is the default Meteohub hostname, but if you have assigned it a different name then use that instead (on the Meteohub web control panel, this is the first line in the 'Network' section of the System Info page. The workgroup, which I mentioned at the top of this post, is the second item.) All the other, text should be exactly as typed above.
4) Save that file with the name "backup.bat" (**NOT backup.txt or backup.bat.txt!) and put it in the folder c:\\cwrsync\\bin
5) Double-click the file and run it to verify you typed the path correctly. A long line of text should scroll past in a command shell and close when finished, which will take anywhere from five minutes a half-hour depending on the amount of historical data you have on your Meteohub. Verify that the backup was successful by opening the 'data' folder (within c:\\cwrsync\\bin). It should have eight folders inside, with the most important one being 'weather'.
6) Assuming step five was successful, open your Control Panel, and select "Scheduled Tasks" or "Performance and Maintenance > Scheduled Tasks" (this varies depending on how you have items set to display in your configuration.) From here, select "add scheduled task".
7) The Scheduled Task Wizard should now be open.
7a) Click 'Next' on the first page and prepare to wait a few minutes while the computer thinks about all the things you might want it to do (it took my system about two minutes and for a while I thought I had crashed, so be patient!)
7b) A list should pop up, with lots of program names in it. Ignore the list and click the 'Browse...' button.
7c) In the window that pops up, navigate to c:\\cwrsync\\bin and select backup.bat. Click 'Open' and it should return you to the first window.
7d) Give the task a name (e.g. 'weather backup' ) and select how frequently to perform the task (I recommend either "Daily" or "When I log on". ) Click 'Next'.
7e) Assuming you picked 'Daily', assign the time to do the backup. Make sure to pick a time that you typically have the computer powered up! Click 'Next'.
7f) It will probably ask for a password and user name. Give it the same details as your normal windows login (if you don't use a password to log in, just leave this blank and click 'Next'.)
7g) A final screen will verify that you have set everything up to run the task every day. Click 'Finish' and you are done.
That's it! Your computer will now backup the Meteohub data on a daily basis, and the best part of cwRsync is that it only re-copies files that have changed since the previous backup, so all future backups should be much faster than the first one.
Re:Auto Backup
Thank you very much for your very detailed description. Now it works for me too. :)
Re:Auto Backup
Hi
have done all that has been laid out, when I run the batch file, I get an error report. This does not stay on the screen long enough for me to copy and paste into "Word" so that I can submit this to the web for you to read and point me in the correct direction.
The program is installed on C:\\cwrsync\\bin and the batch file saved as instructed, this is now a "dos" file. I have tried to read what is on the screen, but it only last's about 1.5 seconds.:ohmy: :ohmy: :huh:
My network is "Home" and meteohub is on 192.168.1.7
The program I downloaded from the web from www.itefix.no/cwrsync, maybe this is the mistake?
have done all that has been laid out, when I run the batch file, I get an error report. This does not stay on the screen long enough for me to copy and paste into "Word" so that I can submit this to the web for you to read and point me in the correct direction.
The program is installed on C:\\cwrsync\\bin and the batch file saved as instructed, this is now a "dos" file. I have tried to read what is on the screen, but it only last's about 1.5 seconds.:ohmy: :ohmy: :huh:
My network is "Home" and meteohub is on 192.168.1.7
The program I downloaded from the web from www.itefix.no/cwrsync, maybe this is the mistake?
Re:Auto Backup
Hi
Managed to grab the screen shot and type it down as below.
rsync: getaddrinfo: Meteohub 873:unknwon Host
rsync error: error in socket IO (code10) at clientserver.c(122) receiver=3.0.4
:unsure:
Thanks
Managed to grab the screen shot and type it down as below.
rsync: getaddrinfo: Meteohub 873:unknwon Host
rsync error: error in socket IO (code10) at clientserver.c(122) receiver=3.0.4
:unsure:
Thanks
- AenG
- Senior Boarder
- Posts: 68
- Joined: Sat Dec 01, 2007 10:06 am
- Location: Boskamp, Netherlands
- Contact:
Re:Auto Backup
works fine here:)
The normal backup from the menu created two files:
meteohub.backup
meteohub.conf
And when a restore i can use the restore button.
But how can i restore the files from rsync?
The normal backup from the menu created two files:
meteohub.backup
meteohub.conf
And when a restore i can use the restore button.
But how can i restore the files from rsync?
Re:Auto Backup
First to answer the problem from binbags -- That error means your computer and Meteohub are not communicating properly. Two possible reasons:
1) Your Meteohub and your PC are in different workgroups (If you are using Windows 2000 or XP, you can right-click on "My Computer", select "Properties" and then go to the "Computer Name" tab to check your workgroup. If it does not match Meteohub's workgroup, change the Meteohub settings to match.)
2) Your Meteohub system hostname is no longer "Meteohub" (go to the Meteohub control panel, on the first screen the workgroup and hostname are provided.)
You can confirm communication by going to Start > Run and type "cmd.exe". In the window that opens, type "ping meteohub" (or whatever your hostname is.) If it returns the message "Ping could not find host meteohub" or something like that, you have a network communication problem and need to debug that before rsync will work.
Alternately, I think that you can also use the IP address instead of hostname, but you will have to test that setting yourself (replace 'Meteohub' in your .bat file with 192.168.x.y). Again confirm your computer can ping 192.168.x.y -- if ping doesn't work then rsync won't work either.
---
Now on to AenG's question about restore -- rSync is not designed to automatically restore data to a client from the backup host. To restore data backed up by rSync, connect to the Meteohub via SMB file sharing and just copy the data over.
The "restore" button on Meteohub is meant to restore your configuration settings that are backed up using the "backup" button on the same page, and will not restore any archived data other than the basic system settings such as license, host name, network configuration, etc.
1) Your Meteohub and your PC are in different workgroups (If you are using Windows 2000 or XP, you can right-click on "My Computer", select "Properties" and then go to the "Computer Name" tab to check your workgroup. If it does not match Meteohub's workgroup, change the Meteohub settings to match.)
2) Your Meteohub system hostname is no longer "Meteohub" (go to the Meteohub control panel, on the first screen the workgroup and hostname are provided.)
You can confirm communication by going to Start > Run and type "cmd.exe". In the window that opens, type "ping meteohub" (or whatever your hostname is.) If it returns the message "Ping could not find host meteohub" or something like that, you have a network communication problem and need to debug that before rsync will work.
Alternately, I think that you can also use the IP address instead of hostname, but you will have to test that setting yourself (replace 'Meteohub' in your .bat file with 192.168.x.y). Again confirm your computer can ping 192.168.x.y -- if ping doesn't work then rsync won't work either.
---
Now on to AenG's question about restore -- rSync is not designed to automatically restore data to a client from the backup host. To restore data backed up by rSync, connect to the Meteohub via SMB file sharing and just copy the data over.
The "restore" button on Meteohub is meant to restore your configuration settings that are backed up using the "backup" button on the same page, and will not restore any archived data other than the basic system settings such as license, host name, network configuration, etc.
- AenG
- Senior Boarder
- Posts: 68
- Joined: Sat Dec 01, 2007 10:06 am
- Location: Boskamp, Netherlands
- Contact:
Re:Auto Backup
Ok, that works fine for the data files. But how to restore the configuration files. I see no config directory or something like that on my meteohub.
Re:Auto Backup
Ah yes, good point! Obviously I did not read the rsync manual correctly the first time because it is designed to restore backups!
To do an automated restore via rsync you can do the following: (Note that this will overwrite any data with the same name on the Meteohub)
rsync.exe -av data rsync://root@meteohub/data
rsync.exe -av config rsync://root@meteohub/config
(same instructions as previous about the host name.)
Note that you could run into problems if your backup is made from one version of Meteohub (e.g. 3.0d) and then you upgrade the software on the Meteohub before doing a restore. (e.g. restoring a 3.0d config onto a machine now running 3.2) so be careful with this!
If you are in doubt, I recommend you restore the data files as outlined here and restore the configuration manually, or via the 'Restore' button as mentioned above. That will ensure that the important settings are restored but will not overwrite anything weird like version data.
I should also mention that in the latest version of the manual (v3.1) this is discussed briefly on page 105-106.
To do an automated restore via rsync you can do the following: (Note that this will overwrite any data with the same name on the Meteohub)
rsync.exe -av data rsync://root@meteohub/data
rsync.exe -av config rsync://root@meteohub/config
(same instructions as previous about the host name.)
Note that you could run into problems if your backup is made from one version of Meteohub (e.g. 3.0d) and then you upgrade the software on the Meteohub before doing a restore. (e.g. restoring a 3.0d config onto a machine now running 3.2) so be careful with this!
If you are in doubt, I recommend you restore the data files as outlined here and restore the configuration manually, or via the 'Restore' button as mentioned above. That will ensure that the important settings are restored but will not overwrite anything weird like version data.
I should also mention that in the latest version of the manual (v3.1) this is discussed briefly on page 105-106.
Re:Auto Backup
Just an "up" to this thread,
I've modified the smb.conf file to add the directory /home/meteohub/ available from windows and who permitted for me to add this directory and public in my general save process.
But browsing to /home/meteohub/ I've found a strange structure : /home/meteohub/meteohub/meteohub/ etc....
Why so much levels ?
I have to save all datas ?
thanks...
I've modified the smb.conf file to add the directory /home/meteohub/ available from windows and who permitted for me to add this directory and public in my general save process.
But browsing to /home/meteohub/ I've found a strange structure : /home/meteohub/meteohub/meteohub/ etc....
Why so much levels ?
I have to save all datas ?
thanks...
Re:Auto Backup
How can i restore data with rsync? It dont work. Both have the same version. I get the following message:
H:\\meteohub\\cwRsync\\bin>rsync.exe -av myconfig rsync://root@meteohub/config
building file list ... done
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(802) [receiver=2.6.9]
rsync: connection unexpectedly closed (4 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(453) [sender=
2.6.9]
H:\\meteohub\\cwRsync\\bin>
"read only" ?? Data logging works. Somebody an idea?
H:\\meteohub\\cwRsync\\bin>rsync.exe -av myconfig rsync://root@meteohub/config
building file list ... done
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(802) [receiver=2.6.9]
rsync: connection unexpectedly closed (4 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(453) [sender=
2.6.9]
H:\\meteohub\\cwRsync\\bin>
"read only" ?? Data logging works. Somebody an idea?
Re:Auto Backup
you can remove the file/link "/home/meteohub/meteohub". This has been produced by one of the updates by accident.
Re:Auto Backup
bensca: Just a guess, but try halting data logging (in the Maintenance tab of Meteohub) before performing the restore. You might be having a problem with two different system threads (the data logger and rsync) fighting over exclusive access to the files.