tar -cvzf destination_folder source_folder -X /home/folder/excludes.txt
-X указывает файл, который содержит список имен файлов, которые должны быть исключены из резервной копии. Для экземпляра вы можете указать * ~ в этом файле, чтобы не включать имена файлов, заканчивающиеся на ~ в резервной копии.
f = open('file.txt','rU')
This opens the file with Python's universal newline support and \r
is treated as an end-of-line.
If it's a concern, open in binary format and convert with this code:
from __future__ import with_statement
with open(filename, "rb") as f:
s = f.read().replace('\r\n', '\n').replace('\r', '\n')
lines = s.split('\n')