Pid files in the home directory are probably a bad idea.
If you run a backup, and later shutdown without backup, you will be left with a pidfile in mydata.tgz.
This will cause a problem at reboot.
Some things to consider:
When checking for a pid file, make sure the pid is still running. If not, delete it.
Store your pid files someplace else like /var/run.