Python question on file backup

Hey everyone. I been on this issue for some time now… I know it’s not panda related, but it is python and I am using panda to run everything lol.

Anyways… I’m close to getting this to work, but having issues redoing the paths to the C drive from the R drive:

  self.CFileDrive = "C:/server/Files/"
  self.RamFileDrive = "E:/Files/"

  #Reupdates the hard drive data with the ram data. Default time is every .1 sec.
  def SaveRamFiles(self, task):
    if self.ReadyList["MoveInToRam"] is 1:
      for root, dir, folder in os.walk(self.RamFileDrive):
        for file in folder:
          src_file = os.path.join(root, file)
          dst_file = os.path.join(self.CFileDrive, file)
          if not os.path.exists(root):
            os.makedirs(root)
          if filecmp.cmp(src_file, dst_file) is False:
            shutil.copy(src_file, dst_file)

    return task.again

dst_file = os.path.join(self.CFileDrive, file) I need to some how change this to add the right path… but I fear I might be doing this the wrong way.

This works by searching for all the files in the RamDrive and add a new path to the C drive recreatoring a 1 to 1 dup of w/e inside (mainly small texts files and some folders).

I hope I explanded it all well. Unless theres a better way of doing this xD?