File size: 392 Bytes
a38b4f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import os
import shutil
from datetime import datetime

SOURCE_DIR = "generated"
ARCHIVE_DIR = f"archive_{datetime.now().strftime('%Y%m%d_%H%M')}"

def archive_all():
    if not os.path.exists(SOURCE_DIR):
        print("No content to archive.")
        return

    shutil.copytree(SOURCE_DIR, ARCHIVE_DIR)
    print(f"Archived to {ARCHIVE_DIR}")

if __name__ == "__main__":
    archive_all()