I almost done everything when backup my home directory then store these compression file in file /var/backups ... but in case I want to encrypt that backup It refuse cuz of

tar: Cowardly refusing to create an empty archive

this is my command

tar -zcvf /home/rehab | gpg --symmetric --cipher-algo aes256 -o 
  • 2
    There is no such directory as var, it should be /var perhaps that's the issue Nov 28, 2019 at 0:11

1 Answer 1


From tar --help:

-f, --file=ARCHIVE         use archive file or device ARCHIVE

With your f option tar is expecting an output file, like foo.tar.gz. So this should work:

tar -zcv /home/rehab | gpg --symmetric --cipher-algo aes256 -o /var/backups/myhome.tar.gz.gpg

Mind the / in front of /var

  • yes that almost work but the permission denied when creating in the /var/backups , even in sudo permission, first ask me about the password of gpg then compress file then encrypt all of them but when put that file in folder /var/backups permission denied
    – Rehab
    Nov 28, 2019 at 14:11
  • To write in /var you need sudo privileges. Nov 28, 2019 at 14:13
  • I write sudo before the command but didn't ask me to enter the sudo password because the window of gpg password displayed in the first , and in root shill the gpg password window didn't display then the output is operation canceled
    – Rehab
    Nov 28, 2019 at 14:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.