Skip to content

Commit 201fcdf

Browse files
committed
Refactoring names in mirror script. Outputting separate logs per drive sync instead of one master log file.
1 parent 73a65b7 commit 201fcdf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# PlexSyncBackup
22

33
### Directions
4-
1. Modify plex-drive-mirror.bat to configure your custom drive syncs using: "CALL :SYNC_DIRECTORY"
4+
1. Modify plex-drive-mirror.bat to configure your custom drive syncs using: "CALL :SYNC_DRIVE"
55
2. Import the task plex-sync-backup-task.xml into Windows Task Scheduler and change as needed

plex-drive-mirror.bat

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
:: Make sure that any USB drives are explicitly assigned drive letters so after reconnection this script wont target an incorrect path
55

66
:: Ensure sync log directory exists
7-
IF NOT EXIST "C:\sync_logs" MKDIR C:\sync_logs
7+
IF NOT EXIST "C:\plex_sync_logs" MKDIR C:\plex_sync_logs
88

99
:: Sync each media drive to its backup drive
10-
CALL :SYNC_DIRECTORY "Anime" "E:\" "R:\"
11-
CALL :SYNC_DIRECTORY "Movies" "F:\" "S:\"
12-
CALL :SYNC_DIRECTORY "Television" "G:\" "T:\"
10+
CALL :SYNC_DRIVE "Anime" "E:\" "R:\"
11+
CALL :SYNC_DRIVE "Movies" "F:\" "S:\"
12+
CALL :SYNC_DRIVE "Television" "G:\" "T:\"
1313

1414
:: Exit from main logic
1515
EXIT /B %ERRORLEVEL%
1616

17-
:: Function that syncs a source directory to a destination backup directory, ignoring any root directory prefixed with "_temp".
17+
:: Function that syncs a source drive to a destination backup drive, ignoring any root directories prefixed with "_temp".
1818
:: (arguments: Name, SourceDirectory, DestinationDirectory)
19-
:SYNC_DIRECTORY
20-
@ECHO Starting sync for %~1 (%date% %time%)... >> C:\sync_logs\log.txt
21-
ROBOCOPY %~2 %~3 /MIR /XJD /MT:4 /R:10 /W:60 /XA:SHT /log+:C:\sync_logs\log.txt /XD _temp* $* "System Volume Information*" /XF *.dat *.sys *.db *.log
19+
:SYNC_DRIVE
20+
@ECHO Starting sync for %~1 (%date% %time%)... >> C:\plex_sync_logs\%~1%-log.txt
21+
ROBOCOPY %~2 %~3 /MIR /XJD /MT:4 /R:10 /W:60 /XA:SHT /log+:C:\plex_sync_logs\%~1%-log.txt /XD _temp* $* "System Volume Information*" /XF *.dat *.sys *.db *.log
2222
EXIT /B 0

0 commit comments

Comments
 (0)