Skip to main content
edited body; edited tags; edited title
Source Link
Mat
  • 54.9k
  • 11
  • 164
  • 143

Linux TAR - Compress a folder with tar?

I'm trying to compress a folder (/var/www//var/www/) to ~/www_backups/$time.tar)~/www_backups/$time.tar where $time$time is the current date.

This is what iI have:

cd /var/www && sudo tar -czf ~/www_backups $time"

I am completely lost and i'veI've been at this for hours now. Not sure if -czf-czf is correct. I simply want to copy all of the content in /var/www/var/www into a $time.tar$time.tar file, and iI want to maintain the file permissions for all of the files. Can anyone help me out?

Linux TAR - Compress a folder?

I'm trying to compress a folder (/var/www/) to ~/www_backups/$time.tar) where $time is the current date.

This is what i have:

cd /var/www && sudo tar -czf ~/www_backups $time"

I am completely lost and i've been at this for hours now. Not sure if -czf is correct. I simply want to copy all of the content in /var/www into a $time.tar file, and i want to maintain the file permissions for all of the files. Can anyone help me out?

Compress a folder with tar?

I'm trying to compress a folder (/var/www/) to ~/www_backups/$time.tar where $time is the current date.

This is what I have:

cd /var/www && sudo tar -czf ~/www_backups $time"

I am completely lost and I've been at this for hours now. Not sure if -czf is correct. I simply want to copy all of the content in /var/www into a $time.tar file, and I want to maintain the file permissions for all of the files. Can anyone help me out?

Source Link
qwerty
  • 5.1k
  • 5
  • 18
  • 13

Linux TAR - Compress a folder?

I'm trying to compress a folder (/var/www/) to ~/www_backups/$time.tar) where $time is the current date.

This is what i have:

cd /var/www && sudo tar -czf ~/www_backups $time"

I am completely lost and i've been at this for hours now. Not sure if -czf is correct. I simply want to copy all of the content in /var/www into a $time.tar file, and i want to maintain the file permissions for all of the files. Can anyone help me out?