Don't risk your backups. Use the Spatie backup package.
If you want to use this script, you don't have to use the Storage package you can use regular PHP commands as well, or just put the path directly into the mysqldump command.
But... whats the point of backups that are still on your VPS?
See Freek's cautionary tale when his provider lost the complete disk for his server;