ads' corner

QNAP: exclude files and directories from rsync

I’m moving files from one QNAP system to another, and I’m using rsync for this. It’s preinstalled on a QNAP system. So far, so good.

To sync entire shared volumes, I want to exclude the @Recently-Snapshot and @Recycle entries - I don’t want to sync the trash bin and I also don’t want to sync entire snapshots.

The usual approach when using rsync is to just use the --exclude option.


Single line input for psql copy command

I have the following problem:

A database server and another client machine. I have to execute several \copy commands in psql on the client machine to retrieve data and store the output in CSV files. The PostgreSQL COPY command is not an option because it stores the results on the database server, not the client machine. All \copy commands are executed from several files containing SQL commands, which are concated together by a Makefile and feeded into psql. So far so good.