bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Tar does not remove files when specifying --remove-files


From: Cobus Aikman
Subject: [Bug-tar] Tar does not remove files when specifying --remove-files
Date: Wed, 11 Jul 2012 09:36:36 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20111004 Lightning/1.0b1 Icedove/3.0.11

Hi

Tar does not remove files after creating the archive (with the -r flag) as stated in the man pages:

With the -c flag it works correctly.

--remove-files
              remove files after adding them to the archive




Here is my script:
address@hidden tmp]$ cat ./tts.sh
echo "hello there" > toets.txt
sleep 1
ls -l toets.txt
tar -rf archivetest.tar toets.txt --remove-files
rc=$?
echo "rc = $rc"
sleep 1
ls -l toets.txt

And the result:

address@hidden tmp]$ ./tts.sh
-rw-rw-r--. 1 cobus cobus 11 Jul 11 09:12 toets.txt
rc = 0
-rw-rw-r--. 1 cobus cobus 11 Jul 11 09:12 toets.txt
address@hidden tmp]$

==========================================================

address@hidden tmp]$ cat ./tts.sh
echo "hello daar" > toets.txt
sleep 1
ls -l toets.txt
tar -cvf archivetest.tar toets.txt --remove-files
rc=$?
echo "rc = $rc"
sleep 1
ls -l toets.txt

address@hidden tmp]$ ./tts.sh
-rw-rw-r--. 1 cobus cobus 11 Jul 11 09:22 toets.txt
toets.txt
rc = 0
ls: cannot access toets.txt: No such file or directory
address@hidden tmp]$


address@hidden tmp]$ uname -a
Linux dev2 2.6.32-220.17.1.el6.x86_64 #1 SMP Wed May 16 00:01:37 BST 2012 x86_64 x86_64 x86_64 GNU/Linux
address@hidden tmp]$




Kind regards

--

Cobus Aikman


address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]