WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: files in /opt/.filetool.lst not backed up during shutdown  (Read 2237 times)

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1494
files in /opt/.filetool.lst not backed up during shutdown
« 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.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1494
Re: files in /opt/.filetool.lst not backed up during shutdown
« Reply #1 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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11570
Re: files in /opt/.filetool.lst not backed up during shutdown
« Reply #2 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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11570
Re: files in /opt/.filetool.lst not backed up during shutdown
« Reply #3 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.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1494
Re: files in /opt/.filetool.lst not backed up during shutdown
« Reply #4 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

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 404
Re: files in /opt/.filetool.lst not backed up during shutdown
« Reply #5 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?