A Little project backing up folders
Posted: 24 Jan 2019 16:46
Hello everyone,
I have just discovered this forum. I have written the odd trivial batch file, nothing sophisticated. My current task is to back up my Music folder on to four USB thumb drives that individually are smaller than the music collection. My pseudo code is below. Please comment on weather this is a reasonable approach given the functionality available in batch programming. Currently I have no clue how to implement this but it's easy to find out with a bit of research.
batch file runs inside Music Folder
treat folders in alphanumeric order
Variable = the folder being copied
copy Variable to F:
exit loop if F: runs out of space
increment Variable to next folder
Loop back to "copy Variable to F:"
Delete Variable from F:
REM last attempt will be a partially copied folder
copy Variable to G:
exit loop if G: runs out of space
increment Variable to next folder
Loop back to "copy Variable to G":
Delete Variable from G:
REM last attempt will be a partially copied folder
copy Variable to H:
exit loop if H: runs out of space
increment Variable to next folder
Loop back to "copy Variable to H":
Delete Variable from H:
REM last attempt will be a partially copied folder
copy Variable to I:
exit loop if I: runs out of space
increment Variable to next folder
exit loop if we run out of folders
Loop back to "copy Variable to G":
Exit
I have just discovered this forum. I have written the odd trivial batch file, nothing sophisticated. My current task is to back up my Music folder on to four USB thumb drives that individually are smaller than the music collection. My pseudo code is below. Please comment on weather this is a reasonable approach given the functionality available in batch programming. Currently I have no clue how to implement this but it's easy to find out with a bit of research.
batch file runs inside Music Folder
treat folders in alphanumeric order
Variable = the folder being copied
copy Variable to F:
exit loop if F: runs out of space
increment Variable to next folder
Loop back to "copy Variable to F:"
Delete Variable from F:
REM last attempt will be a partially copied folder
copy Variable to G:
exit loop if G: runs out of space
increment Variable to next folder
Loop back to "copy Variable to G":
Delete Variable from G:
REM last attempt will be a partially copied folder
copy Variable to H:
exit loop if H: runs out of space
increment Variable to next folder
Loop back to "copy Variable to H":
Delete Variable from H:
REM last attempt will be a partially copied folder
copy Variable to I:
exit loop if I: runs out of space
increment Variable to next folder
exit loop if we run out of folders
Loop back to "copy Variable to G":
Exit