Luke Graham

LAMP Stack Developer

  • Home
  • Who am I?
  • Sample Works
  • Resume
  • Social Media

Backup Program

March 22, 2019 by Luke Graham

Okay, so I wrote this program to back up my Minecraft server’s world that I hosted on my PC for about a month. While it was written to do that, it can be modified slightly to copy any folder to any location. Enjoy.

from shutil import copy
import time
import os
import datetime

src = 'YOUR_PATH_SOURCE'
dst = 'YOUR_PATH_DESTINATION'

def copyy():
    copy(src, dst)

for x in range (1, 1000000000000):
    now = datetime.datetime.now()
    now_time = now.strftime("%b-%a-%d %H-%M-%S")
    os.makedirs('YOUR_PATH_DESTINATION\\%s' % now_time)
    dst = ('YOUR_PATH_DESTINATION\\%s' % now_time)
    copyy()
    print('Copied at %s' % now)
    time.sleep(2400)

Filed Under: Python Scripts

© 2022 · Luke Graham · Powered by Imagely