Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: GNUser on July 03, 2019, 02:52:07 PM

Title: files in /opt/.filetool.lst not backed up during shutdown
Post by: GNUser on July 03, 2019, 02:52:07 PM
I find that the files in tce/mydata.tgz are consistently restored during boot, but never backed up during shutdown. The only way to back them up is to manually run
Code: [Select]
$ filetool.sh -b
I'm actually used to this at this point and like it (I'm guaranteed that config files will be identical between reboots unless I change a file and manually run filetool.sh), but I'd like to "troubleshoot" this to understand TCL a little better. Are there any obvious things to check? /opt/shutdown.sh is marked as executable.
Title: Re: files in /opt/.filetool.lst not backed up during shutdown
Post by: GNUser on July 03, 2019, 09:38:17 PM
I'm not using X, am using 'sudo poweroff' and 'sudo reboot'. I guess neither command runs /opt/shutdown.sh. No problem--if I need backup before poweroff or reboot, I'll create a script that calls filetool.sh first.

http://forum.tinycorelinux.net/index.php?topic=6031.0
http://forum.tinycorelinux.net/index.php?topic=11181.0
Title: Re: files in /opt/.filetool.lst not backed up during shutdown
Post by: Rich on July 03, 2019, 10:02:02 PM
Hi GNUser
I'm not using X, am using 'sudo poweroff' and 'sudo reboot'. ...
Try:
Code: [Select]
exitcheck.sh shutdownor:
Code: [Select]
exitcheck.sh reboot
Title: Re: files in /opt/.filetool.lst not backed up during shutdown
Post by: Rich on July 03, 2019, 10:22:57 PM
Hi GNUser
That wasn't quite right. Make a file called  tcexit  for example:
Code: [Select]
#!/bin/sh
#
# Usage:
# tcexit poweroff    Runs a backup and then shuts off the computer.
# tcexit reboot      Runs a backup and then reboots the computer.

filetool.sh -b
exitcheck.sh $1

Copy it to your  ~/.local/bin  directory and make it executable. It will automatically be include in your path so you can call it directly as
shown in the  Usage:  paragraph above.
Title: Re: files in /opt/.filetool.lst not backed up during shutdown
Post by: GNUser on July 05, 2019, 08:48:21 AM
Thank you, Rich. Yes, that works.
I have gotten used to no backups unless I explicitly make one, but will keep tcexit around in case I change my mind  :D
Title: Re: files in /opt/.filetool.lst not backed up during shutdown
Post by: Greg Erskine on July 05, 2019, 05:54:05 PM
/opt/shutdown.sh has this comment:

# put user shutdown commands here

So originally it was "probably" intended as the place for additional shutdown commands?