Save a file on shutdown

Volumio Information

Volumio Version: 2.806
Hardware: Raspberry Pi3
DAC: HifiBerry DACPlus

Hello,
I need to save laststates.json file on shutdown to keep a trace of album i have listen to.
Made a bash script lastsave.sh copying this file in /home/volumio
Put the script without .sh extension in /etc/init.d
Created a symbolic link with ln -s …/init.d/lastsave K01lastsave (in /etc/rc0.d)
But this doesn’t work : file is not copied
Pi starts and stop without problem
What did I wrong ?
Thanks a lot for help
Eric

look here:
script on shutdown

@Wheaten yes, there is a changeover from the old SysV & init.d to systemd going on in the Linux world. This is also a potential problem for startup scripts that used to go in rc.local too.

Edit: hi Wheaten btw, & welcome to Volumio :smiley: Thankyou for your useful contribution.