I am trying to do a remote backup from behind a firewall. It is really no problem to break this out into its own script that gets called in crontab, but that isn't any fun! What I am trying to do with:
pg_dump -U my_user my_database | ssh me@myserver "> backup.sql"
is to backup a postgresql database (dumps everything to stdout) and redirect that to a remote ssh command that simply places it in backup.sql.
Unfortunately, all I am getting is an empty "backup.sql" on my remote box. Redirection is not my strong point, so any tips would be appreciated. thanks.