WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [solved] Unexpected Restore during bootup in persistence mode  (Read 4559 times)

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Unexpected Restore during bootup in persistence mode
« Reply #15 on: September 16, 2010, 12:55:46 AM »
Changing '/opt/.filetool.lst' does only indirectly influence what happens with the restoration, as is only controls what goes into the backup file. That obviously requires to execute a backup (e.g. filetool.sh -b or at shutdown). Otherwise the old 'mydata.tgz' is still around, and unless you are using bootcode 'norestore' don't be surprised that the old files are re-appearing. You really need to check the contents of your 'mydata.tgz'.

I've now done a re-test of my earlier advice and like to offer the following as a "proof" of that recommendation:
Code: [Select]
tc@box:~$ date > file
tc@box:~$ ls -l file
-rw-r--r--    1 tc       staff           29 Sep 16 04:20 file
tc@box:~$ echo file > list
tc@box:~$ rm -f a.tgz ; busybox tar czvf a.tgz -T list ; echo $? ; ls -l a.tgz
file
0
-rw-r--r--    1 tc       staff          127 Sep 16 04:21 a.tgz
tc@box:~$ tar tzvf a.tgz
-rw-r--r-- tc/staff        29 2010-09-16 04:20:52 file
This is the "normal" case: an entry in the list file results in a non-empty archive file.

Code: [Select]
tc@box:~$ rm -f list
tc@box:~$ rm -f a.tgz ; busybox tar czvf a.tgz -T list ; echo $? ; ls -l a.tgz
tar: can't open 'list': No such file or directory
1
ls: a.tgz: No such file or directory
Having no list file leads to the failure of the 'tar' command, and no archive file gets created.


Code: [Select]
tc@box:~$ rm -f list ; touch list
tc@box:~$ ls -l list
-rw-r--r--    1 tc       staff            0 Sep 16 04:22 list
tc@box:~$ rm -f a.tgz ; busybox tar czvf a.tgz -T list ; echo $? ; ls -l a.tgz
tar: empty archive
1
ls: a.tgz: No such file or directory
Having an empty list file will still results in a failure and the lack of an archive file.

Code: [Select]
tc@box:~$ echo ' ' > list
tc@box:~$ rm -f a.tgz ; busybox tar czvf a.tgz -T list ; echo $? ; ls -l a.tgz
tar:  : No such file or directory
tar: error exit delayed from previous errors
1
-rw-r--r--    1 tc       staff           29 Sep 16 04:23 a.tgz
tc@box:~$ tar tzvf a.tgz
tc@box:~$ echo $?
0
tc@box:~$
Having just a single blank character as an entry in the list file results still in a warning from 'tar', but this time at least an empty archive file gets created.

BTW, it would be enough to do echo > list as the 'echo' command produces in any case a linefeed and hence the list file would not be empty.

Offline souren

  • Newbie
  • *
  • Posts: 17
Re: Unexpected Restore during bootup in persistence mode
« Reply #16 on: September 16, 2010, 01:25:22 AM »
Yup. Thanks Maro for your help.

I'll go with the norestore option...