0

I'm using xcopy and then 7z to copy and compress my whole Onedrive folder. Its very slow and wastes a lot of space by duplicating everything weekly.

I would like to scan the Onedrive folder for changes made in the week prior, and only copy and compress those.. is this possible?

This is what i have so far: (sorry im a bit of a noob!)

@ECHO OFF


Set currdate=%date:/=%


MD F:\ONEDRIVE_weekly_backups\OneDrive

xcopy /s /y /z /k /h /e "F:\OneDrive" "F:\ONEDRIVE_weekly_backups\OneDrive"


7z a -tzip "F:\ONEDRIVE_weekly_backups\ONEDRIVE_BACKUP_%currdate%.zip" "F:\ONEDRIVE_weekly_backups\\OneDrive*" -sdel -mx7
ECHO.

PAUSE
Govind Parmar
  • 20,656
  • 7
  • 53
  • 85
  • 1
    You should look at using the /M option with XCOPY. – Squashman Jan 25 '17 at 19:49
  • 2
    See [this post](http://stackoverflow.com/q/51054/62576). Replace *delete* with *copy*. It should get you started. [See also](http://stackoverflow.com/q/9417913/62576) this robocopy version. – Ken White Jan 25 '17 at 19:50

0 Answers0