Using tar on filenames containing spaces
I had an incremental backup script that produces a tarball of all files that have been amended in the last 7 days. It includes this line:
Code:
tar -rf /var/www/vhosts/<***>/tarbackupw_`date +%Y_%m_%d`.tar `find /var/www/vhosts/<***>/forums -type f -mtime -7` Code:
tar: /var/www/vhosts/<***>/forums/downloads/files/36-rct: Cannot stat: No such file or directory Please can anybody suggest a similar script that will produce a tarball WITHOUT changing the filenames? |
Try that:
Quote:
|
Yes, try:
Code:
tar -rf /var/www/vhosts/<***>/tarbackupw_`date +%Y_%m_%d`.tar `find /var/www/vhosts/<***>/forums -type f -mtime -7 -exec echo "{}" \;` |
Hi Matir
Same idea at the same time! But the double quotes in the echo must be backslashed. |
Oops, yeah, they should be. Sorry, didn't test it before I posted it. :)
|
All times are GMT -5. The time now is 10:28 PM. |