LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to backup to a tarball (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-backup-to-a-tarball-218436/)

majestic 08-16-2004 04:15 PM

How to backup to a tarball
 
Hi,

What is the best command line to backup all files in all sub directories after a certain date? Tar? gzip?



Cheers

Tinkster 08-16-2004 04:17 PM

tar will allow to gzip as you go, and it knows
about a
Code:

      -N, --after-date DATE, --newer DATE
              only store files newer than DATE

too...


Cheers,
Tink

majestic 08-16-2004 04:22 PM

Thanks for the fast response.. so the command is

tar -N 2004-03-22 -czvf archive.tgz *

Cant seem to make that work.

majestic 08-16-2004 04:44 PM

After seraching around I could only find this command:

tar -zcvf archive.tgz `find . -newer temp.txt -type f -print` // all files after date of temp.txt

Tinkster 08-16-2004 04:47 PM

It works for me, try to play with the date's
format... try american ;)

tar -N 15/08/2004 -cvzf backup.tar.gz *


Cheers,
Tink

majestic 08-16-2004 04:55 PM

Hi,

Here's what I get:

[root@kirk ]# ll
total 12
-rwxr--r-- 1 apache apache 1374 Jun 14 21:13 side.sql
-rwxr--r-- 1 apache apache 1151 May 21 08:21 test1.txt
-rwxr--r-- 1 apache apache 50 May 12 16:21 test2.txt
[root@kirk]# tar -N 22/05/2004 -cvzf backup.tar.gz *
tar: side.sql: file is unchanged; not dumped
tar: test1.txt: file is unchanged; not dumped
tar: test2.txt: file is unchanged; not dumped


It produces a file with nothing in it!!

Should produce a file with side.sql only

If I try
tar -N 05/22/2004 -cvzf backup.tar.gz *
side.sql
test1.txt
test2.txt

It backs up everything


All times are GMT -5. The time now is 01:14 PM.