I’m trying to create automated backups of the mysql databases from my virtual host to my NAS storage.
I’m only just starting to learn shell commands so please bear with me – what I’ve found so far is:
mysqldump
-uusername
-ppassword
--opt database_name |
gzip -c |
ssh user@ipaddress
"cat > /path-to-the-directory-on-nas/$(date +%Y-%m-%d_%H.%I.%S).sql.gz"
but this seem to return the following error:
-bash: /path-to-the-directory-on-nas/$(date +%Y-%m-%d_%H.%I.%S).sql.gz: No such file or directory
Does anyone know how to overcome this problem and actually save it to the designated storage?
Change
to
Make sure the folder already exists. At least worked on my Ubuntu 🙂