Hello, hope this fits into the right place.
So here is my issue, I've got a VM running on my Laptop that I'm using just for RAW image work,I'm taking a up a new hobby, photogrphy. I've set aside 100 GB for local file storage just for images. My intent here is to only fire this VM when I need to do any work with the images, RAW edits, imports ,uploads to the web, ect. I've got reasons for not doing it on the host, long story.
As of right now I've set up a backup solution to include rsync and ssh to my file server via the network.
What I'm trying to do is have rsync run at shutdown to sync changes. Since I'll only be using the VM for the images, their is little chance that I'll be running for no reason and cron isn't a feasible idea.
I've tried putting the script in /etc/rc0.d/ to run at shutdown, with no luck. The issues are as follows...
1) The script or rsync never finish running because the shutdown continues and eventually (if not before the script starts, the network is killed and so on)
2) For some reason, when the script is run it doesn't locate my SSH Key and thus requires a password login to the server, Runs find from command line, I'm guessing this is because it's being run by a different user when being invoked during shutdown. Not even sure where to begin on that one.
anyone have an ideas on how to tell shutdown to wait until this script finishes and how to ensure the shutdown execution has access to my user's ssh key?
Happy New Year