tar: Failed to open '/dev/sa0' error in freebsd

ibrahim picture ibrahim · Dec 31, 2011 · Viewed 9.6k times · Source

I have a bash code below under freebsd

tar --files-from $files --exclude-from $xfile -zc \
| openssl aes-256-cbc -salt -pass pass:$PASSWORD -out $1

I have no problem with $files $xfile $PASSWORD or $1 variables, but it gives below error when I run it. Do you know how can I fix it? Thanks for any help...

tar: Failed to open '/dev/sa0'

Answer

Basile Starynkevitch picture Basile Starynkevitch · Dec 31, 2011

I suggest passing -f - to tar (in addition of the other arguments) to indicate that the tar file you want to create is the stdout stream.