I support a company with a remotely hosted web site. They use PostgreSQL dbs.
I can't write scripts on the remote server, and I don't want to store any backup files on the remote server, but I can run cron jobs, and I have access to the remote server's SSH public key. I set up a local linux host to accept the remote host's private key for authentication.
I need to make a one-line script to backup, compress, and scp the backup file to my local linux box synchronously.
If my local linux box was reachable via SSH at
mylinuxbox.foo.com on port 122, and my database's name was
mydatabase, what would this one-liner cron job command look like?