I have a script which creates a nightly backup of several directories.
It is created using
tar -czf, and the destination tar.gz file path is on a mounted network directory. The resulting file is about 1.2Gb large.
The network speed is reasonably fast (copying from the network drive to the local occurs at ~28MB/sec).
Now I want to use public-key encryption to encrypt the tar.gz file before transferring it to the network drive, and would like to know what the best way to do so is.
Should I create the file locally first, encrypt it, and then copy over? Or is there a way to "stream" tar output through an encryption process, and write the results directly to the network drive?