title: Archiving (tar and compress) with metadata (user id, and ctime) in Python
body: <p>I am in the process of backing up a filesystem and I need to make sure that the metadata is conserved (the file owner and creation time). </p>
  
  <p>The <code>tarfile</code> module in Python is really helpful, and I use it extensively in my solution. However, I cannot create the tar file with files conserving their metadata (presumably because <code>copy</code> and <code>copy2</code> cannot do this).</p>
  
  <p>How would you approach this problem from within Python?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Just to make it clear to the community: the <code>tarfile</code> module in Python <strong>does</strong> provide means to store metadata via the <code>Tarinfo</code> object. Essentially, a <code>Tarinfo</code> object is the member of a <code>Tar</code> object, and it has all the information you may need. Please refer to the accepted post.</p>
  
  <p>Thanks!</p>