TUTORIAL: how to set an automatic backup of your scheduled records
2 participantes
Página 1 de 1.
TUTORIAL: how to set an automatic backup of your scheduled records
Hi all,
Did you ever notice, at night before going bed or after dinner, that there was no red light showing an ongoing TV recording on your MS4x0H despite you did scheduled one (worse, a weekly one for your preferred TV serie)?
Did you then power on your box, push timer rec and discover a terribly empty list, without any mention of the seven or more scheduled recordings you had to enter manually (since there is no correct epg...)?
If that already happened to you, there is now a solution, thanks to a software generated by Victor, that does backup of the current dB if not empty and restore it if empty.
NB: after discussion with Victor, this could not do the backup job correctly in case you have edited your schedule records database to add triggers so that records actually begin earlier and finish later. This indeed changes the size of the db. I did not use this btw very interesting trick because I usually records programs that have different types of time inaccuracies, sometimes bigger than 30min (since in the second half of the evening).
Disclaimer: usual one: by doing that, you are modifying the way your LG is actually working and the way LG planned your box to be working. Be careful, you can trash it, and will be the sole responsible of what you're doing with it, etc, etc.
What you need
You will need a telnet client, a working internet connexion (to keep it simple ... but you can also use a usb key to transfer the software), where both your pc/mac and your LG are connected. You will also need to know how to use vi, what is fairly simple in fact but you can not guess how it works (edition mode is set with a push on letter i to insert characters at the position where you stay in a file (before the place you are hovering over, then), a to append characters after that position, r to replace a single character under you position, uppercase R to replace more than one characters, esc to quit the edition mode, :wq to save and quit the file, :q! to quit the file without saving ...)
Also take a beer, I wrote a long thing :p
What to do
Here are the steps to get this solution up and running.
1- Adding an autorun: the rcS.addon script
ref: http://ms450h.forumactif.com/personnalisation-astuces-et-modding-f11/mise-au-point-d-un-autorun-t134.htm
Hopefully you already have set up an autorun, e.g. an rcS.addon script automatically launched at the end of the actual rcS, and can then directly go to step 3. Otherwise I would recommend to set it up now and takes benefit of editing the rcS for (web) remote control (optional step 2)
a- Telnet to the LG with your telnet client (I used Putty). Login is root , password is mugung ...
b- make a backup of your rcSfile (in case)
c- Edit the rcS file
then push the letter a (you are now in edition mode, appending something to the last word of the file)
then push enter to create a newline (or two )
cut and paste the following code (right click of the mouse with Putty to paste it within the file):
Then press escape key to go back to command mode and then put :wq followed by enter to save your change. You should be back to the initial telnet prompt.
d- create the rcS.addon file
Goes to edition mode by pressing i and copy paste the following:
By doing this you have created a rcS.addon file that will be launched at the startup of the LG. By the way, since everything is commented out within that script, it will trigger nothing for the time being. The goal of creating it is to make sure you won't need later to modify the rcS file, if you want to launch extra things.
2- optional step: adapt the rcS to allow (web) remote control, zapping to DTV at launch, etc.
That step is absolutely not needed for the auto backup to run. But since you know how to modify the rcS script, let's try to do it once again, for the very last time (any future autorun will be set with the rcS.addon file created in step 1).
ref:
ES: https://ms450.forosactivos.net/tutoriales-f4/al-arrancar-va-directamente-a-ver-la-television-tdt-t272.htm
FR: http://ms450h.forumactif.com/tutos-f10/demarrage-automatique-sur-une-chaine-tv-t207.htm
a- Load the rcS file with vi
b- Edit the first place (auto creation of buffer file that will relay commands to the LG programs)
Look for the right pattern by issuing, still in command mode, the following string:
Set your cursor at the end of this line (with your arrows) then goes to edition mode by pressing a
Insert one or two lines by pressing enter once or twice
Copy paste the following:
c- Locate and edit the second place
still in command mode, search for the pattern DvdPlayer by writing /DvdPlayer
you should then have your cursor at a line looking like:
./RootApp DvdPlayer&
If not, search it by hand, it should not be very far
With your keyboard arrows, go to the beginning of the line, over the .
insert the tail-f command by pressing letter i and then copy pasting the following (last space included):
The line should now look like:
tail -f /tmp/command_sender.txt | ./RootApp DvdPlayer&
d- Locate and edit the third place
A few lines below, you can see a line looking like:
./DvdPlayer&
With your keyboard arrows, go to the beginning of the line, over the .
insert the tail-f command by pressing letter i and then copy pasting the following (last space included):
The line should now look like:
tail -f /tmp/command_sender.txt | ./DvdPlayer&
e- save the rcS and never touch it again later
press the following sequence in command mode :wq followed by enter
You should be back to the telnet session
3- get the software thanks to your internet connexion
go the right place and download Victor's backup program by copy pasting the following in the telnet sessions
4- edit the rcS.addon script
# echo " " >> /tmp/command_sender.txt
Hit the r button and then space (you went in edition mode for only one letter, and replaced # by a space)
In any case, you want to add the backup soft in the autorun, so goes to the end of the file with you arrows, press a and enter to create a new line and copy paste the following 4 lines:
Save your file by issuing :wq followed by enter.
You should be back to the telnet session
5- reboot the box:
either do power on/power off with the remote control or put reboot in the command line
And here, you're done
Did you ever notice, at night before going bed or after dinner, that there was no red light showing an ongoing TV recording on your MS4x0H despite you did scheduled one (worse, a weekly one for your preferred TV serie)?
Did you then power on your box, push timer rec and discover a terribly empty list, without any mention of the seven or more scheduled recordings you had to enter manually (since there is no correct epg...)?
If that already happened to you, there is now a solution, thanks to a software generated by Victor, that does backup of the current dB if not empty and restore it if empty.
NB: after discussion with Victor, this could not do the backup job correctly in case you have edited your schedule records database to add triggers so that records actually begin earlier and finish later. This indeed changes the size of the db. I did not use this btw very interesting trick because I usually records programs that have different types of time inaccuracies, sometimes bigger than 30min (since in the second half of the evening).
Disclaimer: usual one: by doing that, you are modifying the way your LG is actually working and the way LG planned your box to be working. Be careful, you can trash it, and will be the sole responsible of what you're doing with it, etc, etc.
What you need
You will need a telnet client, a working internet connexion (to keep it simple ... but you can also use a usb key to transfer the software), where both your pc/mac and your LG are connected. You will also need to know how to use vi, what is fairly simple in fact but you can not guess how it works (edition mode is set with a push on letter i to insert characters at the position where you stay in a file (before the place you are hovering over, then), a to append characters after that position, r to replace a single character under you position, uppercase R to replace more than one characters, esc to quit the edition mode, :wq to save and quit the file, :q! to quit the file without saving ...)
Also take a beer, I wrote a long thing :p
What to do
Here are the steps to get this solution up and running.
1- Adding an autorun: the rcS.addon script
ref: http://ms450h.forumactif.com/personnalisation-astuces-et-modding-f11/mise-au-point-d-un-autorun-t134.htm
Hopefully you already have set up an autorun, e.g. an rcS.addon script automatically launched at the end of the actual rcS, and can then directly go to step 3. Otherwise I would recommend to set it up now and takes benefit of editing the rcS for (web) remote control (optional step 2)
a- Telnet to the LG with your telnet client (I used Putty). Login is root , password is mugung ...
b- make a backup of your rcSfile (in case)
- Código:
cp /usr/local/etc/rcS /usr/local/etc/OLDrcS1
c- Edit the rcS file
- Código:
vi /usr/local/etc/rcS
then push the letter a (you are now in edition mode, appending something to the last word of the file)
then push enter to create a newline (or two )
cut and paste the following code (right click of the mouse with Putty to paste it within the file):
- Código:
( for i in 1 2 3 4 5 6 7 8 9 10; do /bin/sleep 6; if [ -f /tmp/hdd/root/rcS.addon ]; then /tmp/hdd/root/rcS.addon; break; fi; done )& #rcS.addon
Then press escape key to go back to command mode and then put :wq followed by enter to save your change. You should be back to the initial telnet prompt.
- Spoiler:
- You can change the # part of place of its content, it's a comment, you can also add others but be very careful when modifying this file, otherwise you can "soft break" your receiver and then need to manually force a firmware update to reset its system. See here if needed:
http://ms450h.forumactif.com/tutos-f10/update-usb-en-cas-de-corruption-de-la-nand-t41.htm
If you did something wrong but can still telnet in the LG you can also restore the previous rcS:
cp /usr/local/etc/OLDrcS1 /usr/local/etc/rcS
d- create the rcS.addon file
- Código:
touch /tmp/hdd/root/rcS.addon
chmod ugoa+x /tmp/hdd/root/rcS.addon
vi rcS.addon
Goes to edition mode by pressing i and copy paste the following:
- Código:
#!/bin/sh
# following command is to automatically start on the last DTT channel rather than on the home page
# uncomment the line with a # if you want to activate it BUT ONLY if you have modified your rcS file
# to add a tail -f /tmp/command_sender.txt | pipe before the launch of RootApp and DVDPlayer, otherwise it won't work
# echo " " >> /tmp/command_sender.txt
By doing this you have created a rcS.addon file that will be launched at the startup of the LG. By the way, since everything is commented out within that script, it will trigger nothing for the time being. The goal of creating it is to make sure you won't need later to modify the rcS file, if you want to launch extra things.
2- optional step: adapt the rcS to allow (web) remote control, zapping to DTV at launch, etc.
That step is absolutely not needed for the auto backup to run. But since you know how to modify the rcS script, let's try to do it once again, for the very last time (any future autorun will be set with the rcS.addon file created in step 1).
ref:
ES: https://ms450.forosactivos.net/tutoriales-f4/al-arrancar-va-directamente-a-ver-la-television-tdt-t272.htm
FR: http://ms450h.forumactif.com/tutos-f10/demarrage-automatique-sur-une-chaine-tv-t207.htm
a- Load the rcS file with vi
- Código:
vi /usr/local/etc/rcS
b- Edit the first place (auto creation of buffer file that will relay commands to the LG programs)
Look for the right pattern by issuing, still in command mode, the following string:
- Código:
/cd $DEFAULT_AP_DIR
Set your cursor at the end of this line (with your arrows) then goes to edition mode by pressing a
Insert one or two lines by pressing enter once or twice
Copy paste the following:
- Código:
touch /tmp/command_sender.txt
c- Locate and edit the second place
still in command mode, search for the pattern DvdPlayer by writing /DvdPlayer
you should then have your cursor at a line looking like:
./RootApp DvdPlayer&
If not, search it by hand, it should not be very far
With your keyboard arrows, go to the beginning of the line, over the .
insert the tail-f command by pressing letter i and then copy pasting the following (last space included):
- Código:
tail -f /tmp/command_sender.txt |
The line should now look like:
tail -f /tmp/command_sender.txt | ./RootApp DvdPlayer&
d- Locate and edit the third place
A few lines below, you can see a line looking like:
./DvdPlayer&
With your keyboard arrows, go to the beginning of the line, over the .
insert the tail-f command by pressing letter i and then copy pasting the following (last space included):
- Código:
tail -f /tmp/command_sender.txt |
The line should now look like:
tail -f /tmp/command_sender.txt | ./DvdPlayer&
e- save the rcS and never touch it again later
press the following sequence in command mode :wq followed by enter
You should be back to the telnet session
3- get the software thanks to your internet connexion
go the right place and download Victor's backup program by copy pasting the following in the telnet sessions
- Código:
cd /tmp/hdd/root
wget http://dl.dropbox.com/u/684543/varios/ms450h/Aplicaciones/RecListBackup/RecListBackup2
chmod ugoa+rx ./RecListBackup2
4- edit the rcS.addon script
- Código:
vi rcS.addon
# echo " " >> /tmp/command_sender.txt
Hit the r button and then space (you went in edition mode for only one letter, and replaced # by a space)
In any case, you want to add the backup soft in the autorun, so goes to the end of the file with you arrows, press a and enter to create a new line and copy paste the following 4 lines:
- Código:
# This command launch a backup or restore of the schedule_record.db depending of the state of the file
# if empty (below a certain size), it restore the previous db, otherwise it saves it
/tmp/hdd/root/RecListBackup2
Save your file by issuing :wq followed by enter.
You should be back to the telnet session
5- reboot the box:
either do power on/power off with the remote control or put reboot in the command line
And here, you're done
Última edición por matthelas el Vie Abr 23, 2010 1:24 pm, editado 3 veces
matthelas- Mensajes : 145
Fecha de inscripción : 08/02/2010
Re: TUTORIAL: how to set an automatic backup of your scheduled records
GUAYYY
Thanks very much for the tutorial.
regards
Thanks very much for the tutorial.
regards
vic1972- Mensajes : 2260
Fecha de inscripción : 09/12/2009
Edad : 52
Localización : Malaga
Re: TUTORIAL: how to set an automatic backup of your scheduled records
Lol, you deserved a special effort
Thanks for the soft!!
Cheers,
Matt
Thanks for the soft!!
Cheers,
Matt
matthelas- Mensajes : 145
Fecha de inscripción : 08/02/2010
Temas similares
» "Scheduled stop" status in history viewer
» Directorio/Backup de dtv_channel.txt por ciudades principales
» TUTORIAL: update firmware via USB
» TUTORIAL: PM/LG Menu v1.0.1
» TUTORIAL: PM/LG Menu v103
» Directorio/Backup de dtv_channel.txt por ciudades principales
» TUTORIAL: update firmware via USB
» TUTORIAL: PM/LG Menu v1.0.1
» TUTORIAL: PM/LG Menu v103
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.