Support for reading from stdin and dumping db to a file

If the only access you have to the log is via cat or tail from ssh connection, the script will need reading from stdin.
And maybe you want backup in a file the data you're printing.