Backing up the /hack directory and all sub directories

Discussion in 'TiVo Series 1 - UK' started by gwgw45, Dec 3, 2004.

  1. Dec 3, 2004 #1 of 40
    gwgw45

    gwgw45 New Member

    135
    0
    Nov 25, 2004

    Advertisements

    For some reason (probably dying HDD that I am planning to replace) I lost my hack directory completely. Is there anyway I can back it up for the future. Also, are there any other files or directiries I should back up?

    Thanks all
    G.
     
  2. Dec 3, 2004 #2 of 40
    dommac2000

    dommac2000 New Member

    22
    0
    Jun 2, 2002
    Have a look at showthread.php?threadid=159558 (sorry can't post full URL)
     
  3. Dec 3, 2004 #3 of 40
    gwgw45

    gwgw45 New Member

    135
    0
    Nov 25, 2004
    Thanks a lot Douggie, unfortunately I can't find the thread in question:-(

    G.
     
  4. Dec 3, 2004 #4 of 40
    dommac2000

    dommac2000 New Member

    22
    0
    Jun 2, 2002
    Try h t t p : / / w w w . tivocommunity.com/tivo-vb/showthread.php?threadid=159558
     
  5. Dec 3, 2004 #5 of 40
    scgf

    scgf New Member

    240
    0
    Oct 24, 2000
    Market...

    Advertisements

    What I do is use an ftp application to drag from the TiVo a copy of the /var/hack directory. I then store it on my Mac's hard drive.

    Not sure how I would reinstate it if I lost network access to the TiVo though. At least I wouldn't lose all my hacks once I had restored net access.
     
  6. Dec 3, 2004 #6 of 40
    gwgw45

    gwgw45 New Member

    135
    0
    Nov 25, 2004
    Thanks Dougie (notice just one g this time) :)
     
  7. Dec 3, 2004 #7 of 40
    gwgw45

    gwgw45 New Member

    135
    0
    Nov 25, 2004
    What command line do you use for this?

    Thanks
    G.
     
  8. Dec 3, 2004 #8 of 40
    gwgw45

    gwgw45 New Member

    135
    0
    Nov 25, 2004
    Would you mind telling me what the command line was that you used?

    Thanks
    G
     
  9. Dec 3, 2004 #9 of 40
    6022tivo

    6022tivo A Happy Member

    2,062
    1
    Oct 29, 2002
    UK
    http://www.tivocommunity.com/tivo-vb/showthread.php?threadid=159558

    Is the thread.

    The problem with the FTP method you use to drag the hack folder to the PC is that you will lose all the permissions on the files if you restored them (the chmod thingies).

    I have not got my method to hand, but I run the gzip command or what even, it creates a compressed file of the hack folder including the permissions, then I ftp it to my pc. If any problems, ftp the gzip file back then expand it, all permissions intact.
     
  10. scgf

    scgf New Member

    240
    0
    Oct 24, 2000
    Market...
    I hadn't thought of the permissions. I have just checked my backup and it looks like the permissions are intact - maybe because I use Mac OS X which is a Unix operating system.

    So, if you don't use a Mac, ignore my advice!

    gwgw45 - all I did was drag the /var/hack folder from the ftp gui window onto my Mac desktop.

    Strange, isn't it, that the TiVo is essentially a Mac (at least in that it uses PPC architecture) and uses Unix, like the Mac, yet all the hacking we do has to be done on a PC using an alien architecture and using an Linux OS compiled for Intel. I suppose it has to do with the sheer numbers of PCs around.
     
  11. gwgw45

    gwgw45 New Member

    135
    0
    Nov 25, 2004
    Thanks, whatn you say makes a lot os sense! If you were to come across your method I would be delighted to see it:)

    Cheers
    GWGW45
     
  12. 6022tivo

    6022tivo A Happy Member

    2,062
    1
    Oct 29, 2002
    UK
    TO BACKUP

    tar -cvh hack | gzip > hack.tar.gz

    from the /var directory..
    This created a 2.5MB file in the var directory which I ftp'd to my PC.


    Now if all fails I can ftp the file back to /var and then run

    gzip -d hack.tar.gz
    cpio -H tar -i < hack.tar

    from the /var directory and all should be back to normal after a restart??
     
  13. gwgw45

    gwgw45 New Member

    135
    0
    Nov 25, 2004
    Thank you so much, really, really appreciated!

    GWGW45
     
  14. ericd121

    ericd121 Crown Topper

    1,347
    0
    Dec 12, 2002
    Milton...
    I'm using
    0 05 * * 1 tar -cvh hack | gzip > hack.tar.gz
    in my TiVos' crontabs (to back up the hack dir) and checking today, I've found the hack.tar.gz file, dated last Monday, is empty on both TiVos.

    I haven't a clue what's happening; does anyone else?

    crontab is in /var/hack/etc and is running the delmanual command without a hitch.

    Is this one of those Read Only - Permissions - type things? :confused:

    [Edit]
    I just ran the command manually, and it does appear the TiVo need to be set to Read/Write

    [Double Edit]
    It appears I was looking in the wrong dir...
    The file is present and correct in the /var dir and not in the /var/hack dir which was the one being backed up... :eek:
     
  15. 6022tivo

    6022tivo A Happy Member

    2,062
    1
    Oct 29, 2002
    UK
    Hello

    I hadn't thought of adding it to cron..

    I back it up in case the var directory is cleared, like tivo does when having a paddy. But I ftp it to the pc as the backup file would be deleted also when var is cleared.

    Can the backup file be saved to anywhere, or are all the other locations read only??

    Can it be backed up via cron to a PC?? Shared drive etc??.
     
  16. bobones

    bobones New Member

    91
    0
    Jan 22, 2004
    You could create a scheduled job under windows (control panel) that downloads the backup file using ftp. For example:

    c:\backup\tivobak.bat
    Code:
    ftp -s:tivo.ftp tivo
    c:\backup\tivo.ftp
    Code:
    bin
    cd /var
    get tivobak.tgz
     
  17. 6022tivo

    6022tivo A Happy Member

    2,062
    1
    Oct 29, 2002
    UK
    Fantastic......

    Now have edited cron to include the backup, have used your time Eric of 0 05 * * 1
    Is this 5 past midnight every Monday????? if not please let me know and I will change it?

    Also have a script running everytime my PC boots to backup data folders to a network standalone hard drive, have just added what you said bobbones, cheers.

    Had to alter the ftp script and added a couple of blank lines as it requires you to press enter twice to bypass the login password that is not needed, also added QUIT at the end to release back to the bat file.


    Thanks again, now a happier bunny, cheers Phil.
     
  18. CarlWalters

    CarlWalters Yo Ho TiVo!

    644
    0
    Oct 17, 2001
    RG4,...
    Excellent :D

    I've now done this so that I should have an automated backup of /var/hack once per week. I had to download tar from
    here and I made a couple of changes to the two script files. First to supress the ftp login and then to quit at the end so my files look like

    Code:
    @echo off  
    rem file to get the TiVo /var/hack backup file which is /var/hack.tar.gz  
    rem /var/hack.tar.gz is created automatically once per week (on Monday)
    rem using the cron crontab entry  
    rem # m  h dom mon dow command  
    rem 0 05 * * 1 tar -cvh /var/hack | gzip > /var/hack.tar.gz&  
    ftp -n -s:tivo.ftp tivo
    
    Code:
    bin
    cd /var
    get hack.tar.gz
    quit
    
     
  19. Restorer

    Restorer New Member

    132
    0
    Jan 6, 2002
    NE England
    Can someone please tell me what is tar, where can I get it and which directory does it go in? When I try to run 6022's command line (tar -cvh hack | gzip > hack.tar.gz) I get "tar:command not found" although it does create an (empty) hack.tar.gz file.
     
  20. dommac2000

    dommac2000 New Member

    22
    0
    Jun 2, 2002
    Tar is an archiver. CarlWalters posted the link in the previous post - http://tivo.samba.org/download/mbm/bin/

    The tar program should go somewhere in your path (usually /var/hack/bin) and made executable.
     

Share This Page

spam firewall

Advertisements