I'm trying to compress a directory but I want to change the tar
file name to have the current date. The problem is that tar
doesn't accept:
#!/bin/bash
tar -cvjSf $(date +%d/%m/%y.%HH:%MM)home_backup.tar.bz2 /home
I want to make a compressed File with bzip2 with the actual date but the name is not accepted. It only works if I use a simple name like:
#!/bin/bash
tar -cvjSf home.tar.bz2 /home