I wanted to do incremental backups using tar. I made a full backup in 2012-04-08, and later I wanted to back up all files created or modified after this date.
So, I did something like this:
cd /directory/I/wanted/to/back/up
tar --newer 2012-04-08 -cvnf "/backup/dir/$(date +%F).tar"
After some time, I realized that tar is archiving files that, as I know, have not changed since the last backup. I checked their modification dates and should not be included.
I do not believe, so I did a little test:
cd ~
mkdir test
cd test
touch -t 201101010000 OLD
touch NEW
cd ..
tar -N 2012-01-01 -cvf test.tar ./test/*
tar -tf test.tar
ls -o ./test/
Obviously tar ignores the -N, --newer, and - after-date options. He archived both files, although the one I named OLD was created with a timestamp until 2012.
How can I help myself with this?
source
share