enter image description hereI'm trying to save a file on DISK E of the Windows server and save it in another folder in the same location using Python. But I'm always getting this error:enter image description here
OSError: [WinError 123] The syntax for the file name, directory name, or volume label is incorrect: 'E:\x07utomatic_backups\Auto_backup_mysql.sql'
My Python code:
import os
import shutil
import uuid
source = 'E:\automatic_backups\Auto_backup_mysql.sql'
files = os.listdir(source)
newLOcal = 'E:\automatic_backups\backup'
for filename in os.listdir(source):
if filename == "Auto_backup_mysql.sql":
uuid_code = uuid.uuid4().hex
backupName = uuid_code + '_' + filename
src = os.path.join(source,filename)
dst = os.path.join(newLOcal, backupName)
shutil.copy(src, dst)`
I would like to save a file from automatic_backups folder for backup.