Just as master said: First of all sorry for my poor English.
1- He doesn't know how to search for the latest version of a specific file
I'd use the windows search with something like "name:file.ext" and I would get a list of the matches which I can order by date directly in windows explorer
2- For a single file, the former solution works, but when you need to get the latest version of each file (or a lot of files) it will become a long repetitive taks
As Luis stated in other post, you need to revoer each folder in reverse order
Pauloco gave us a good solution for people usin incremental backups with compression:
We don't really need any restore script.
The first time I used cobian backup, I had a hard time understanding that there was no restore system. Later, I realized that to restore a full backup, it was as simple as copy and paste.
Differential backups
We only need 2 simple steps:
For the compressed backups, we can use the solution in Pauloco's link. As now, the link is broken but I've been able to get to it form a web archive here
To make a full version of the backup files with the latest version of each file, all you need is to run CMD and
- First you need to go to the backups path in CMD (CD <some path>)
- And then run the following command:Explanation:
dir /b/on:
/b parameter: shows only file names, no other summary info
/on parameter: Order by name, older files will be procesed first
for /f “delims=” %a in (list_of_files) do (uncompress_file)
/f parse the output of dir
“delims=” set a delimiter, nothing in our case
%a, will be the file name in each loop
in (), will be the full list of files got by dir command
do (), will be the command to apply at each file, 7-zip in my case
7z e %a -od:\restored -aoa
x, extract files with its original folder structure
“%a”, the filename provided by for
-od:\restored, the destination folder
-aoa, options to overwrite any existing file. As we are extracting in order, newer files will overwrite older files.
Note: 7z.exe must be in your path variable or you should call with its full path. I added 7z to my PATH variable with:
set PATH=%PATH%;C:\Program Files\7-Zip
Credits for the command: Tomás Crespo García
Uncompressed incremental backups
For uncompressed backups (just the folders and fiels), I've made a new command, based on Thomás's one.
You can run this commands directly in cmd or just from a .bat file.
If you are using the FOR command at the command line rather than in a batch program, use just one percent sign: %a instead of %%a
As you'll see, the logic is the same, and I've only replaced the 7z restore command for a robocopy command.
Prerequisites:The interesting part is the one of mixing a "for... do" command with a "dir /on"
I think now we have the instructions / scripts needed to handle all kind of sets of solutions.
I get the point but sometimes, we neeed incremental backups to save space. My server's sites take a little more than 30GB and I need to keep so many different versions of updated scripts. I mean:Yes. Do not create separated backups OR use differential backups. Differential are a lot easier to recover than incremental
- I need to limit the amount of full bakcups
- I used to to differential bakups but, once the full backup becomes older, incremental backups begin to take serveral GBs (per day) so, thats not a good solution for me
- Incremental backups let me keeping all versions of each file for, lets say, a whole year, with a quite low space requirement
1- He doesn't know how to search for the latest version of a specific file
I'd use the windows search with something like "name:file.ext" and I would get a list of the matches which I can order by date directly in windows explorer
2- For a single file, the former solution works, but when you need to get the latest version of each file (or a lot of files) it will become a long repetitive taks
As Luis stated in other post, you need to revoer each folder in reverse order
When you need to recover all, you may be in a hurry (recovery from disaster) and you need to be able to recover the files in a faster way than copying each bakcup folder in reverse older.First the oldest Full backup, then the oldest incremental, then the next older..until the newest
Pauloco gave us a good solution for people usin incremental backups with compression:
Continuing with this:And an automated solution would be very handy. I found anarticle that might help.
Full backupsNonetheless, Luis, I think it would really be awesome to have a bunch of step by step instructions, maybe evn some scripts to handle all kind of sets of solutions. For example Full / Incremental / Differential with and without zip/7z compression.
We don't really need any restore script.
The first time I used cobian backup, I had a hard time understanding that there was no restore system. Later, I realized that to restore a full backup, it was as simple as copy and paste.
Differential backups
We only need 2 simple steps:
- Copy / paste the full backup
- Copy / paste the latest differential backup and overwrite duplicated files
For the compressed backups, we can use the solution in Pauloco's link. As now, the link is broken but I've been able to get to it form a web archive here
To make a full version of the backup files with the latest version of each file, all you need is to run CMD and
- First you need to go to the backups path in CMD (CD <some path>)
- And then run the following command:
Code:
for /f “delims=” %a in (‘dir /b/on’) do 7z x “%a” -od:\restored -aoa
dir /b/on:
/b parameter: shows only file names, no other summary info
/on parameter: Order by name, older files will be procesed first
for /f “delims=” %a in (list_of_files) do (uncompress_file)
/f parse the output of dir
“delims=” set a delimiter, nothing in our case
%a, will be the file name in each loop
in (), will be the full list of files got by dir command
do (), will be the command to apply at each file, 7-zip in my case
7z e %a -od:\restored -aoa
x, extract files with its original folder structure
“%a”, the filename provided by for
-od:\restored, the destination folder
-aoa, options to overwrite any existing file. As we are extracting in order, newer files will overwrite older files.
Note: 7z.exe must be in your path variable or you should call with its full path. I added 7z to my PATH variable with:
set PATH=%PATH%;C:\Program Files\7-Zip
Credits for the command: Tomás Crespo García
Uncompressed incremental backups
For uncompressed backups (just the folders and fiels), I've made a new command, based on Thomás's one.
You can run this commands directly in cmd or just from a .bat file.
Code:
SET v_backups_dir=c:\backups\cobianSET v_restore_dir=c:\my_restore_dircd %v_backups_dir%for /f "delims=" %%a in ('dir /b/on') do (robocopy "%v_backups_dir%\%%a" "%v_restore_dir%" /s /mt /z /copyall /dcopy:DAT)
As you'll see, the logic is the same, and I've only replaced the 7z restore command for a robocopy command.
Prerequisites:
- A source folder with the latest full backup an later later incremental backups.
- Set the variables with the source and destination directories and run the command.
Code:
SET v_backups_dir=c:\backups\cobianSET v_restore_dir=c:\my_restore_dircd %v_backups_dir%for /f "delims=" %%a in ('dir /b/on') do (copy /y "%v_backups_dir%\%%a" "%v_restore_dir%")
I think now we have the instructions / scripts needed to handle all kind of sets of solutions.
Statistics: Posted by Bourch — 03 Jan 2023, 23:06