mina86 |
08-10-2018 06:51 PM |
Quote:
Originally Posted by m0rt
(Post 5890345)
the -P is for me to respect the absolute paths otherwise it sends me another error message of the character "/"
|
Yes, that’s because typically having absolute path names in tar archives is a bad idea and may be dangerous. What you want is:
Code:
tar -C /home -cvf "/tmp/resp-$USER-$Fecha.tar" "$USER"
or slightly less magical:
Code:
cd /home; tar -cvf "/tmp/resp-$USER-$Fecha.tar" "$USER"
Unless you really want full path in the archive in which case:
Code:
tar -C / -cvf "/tmp/resp-$USER-$Fecha.tar" "/home/$USER"
Quote:
Originally Posted by scasey
(Post 5890349)
I can see that would cause a question.
Couple more suggestions: - Compare the version and the man pages on the two machines.
|
No need for such tedious tasks. tar --version would very likely show that both systems use the same tar.
Quote:
Originally Posted by jsbjsb001
(Post 5890338)
From tar's man page:
Code:
tar [OPTION...] [FILE]...
Once again, read it.
|
Perhaps OP has read it and noticed:
Code:
For example, the c option requires creating the archive, the v option
requests the verbose operation, and the f option takes an argument that
sets the name of the archive to operate upon. The following command,
written in the traditional style, instructs tar to store all files from
the directory /etc into the archive file etc.tar verbosely listing the
files being archived:
tar cfv a.tar /etc
Emphasis mine. So yeah…
(But what confused me the most is why people continued discussing this after I’ve pointed out the problem).
|