Ir al contenido principal

Entradas

My Backup script for Mac

Recently I bought an external disk of 1 terabyte. This comes to replace my old 250 MB disk. The fists thing I made was to format the disk and create 1 partition to store all the information. As I wanted to use the disk with Mac and PC, I formatted it as NTFS. I also acquire a Mac utility to support writing to NTFS. The disk worked fine until I tried to use backup tools for Mac. Most of the backup tools for Mac require a disk formatted in Mac format. But in my case it is NTFS. A solution might be to create 2 partitions, one for Mac and one for PC, but the one of Mac might not be available in PC. Still I want the compatibility with both systems. My backup requirements for Mac were easy: Back up only data files Maintain only the image at the time the backup is made Do not backup OS and Apps. In case of failure, those can be restored from the installation disk and packages. I was about to format the disk with the 2 partitions when I realize I already had 500MB of information in the
Entradas recientes

Scheduled tasks - Simple scripts for Backup in Windows using MSDOS

To automatically create a daily incremental backup I’ve schedule a task in windows’ Scheduled Tasks. The only setting are the script to run and the recurrent schedule, by default, the script will do the rest. For my PC, I’m using a daily execution at 5PM. The script will be: D:\>Backup.cmd Before the first execution, I performed a Full backup. D:\>Backup.cmd full

FullRestore.cmd - Simple scripts for Backup in Windows using MSDOS

The last option we need in order to have a [almost] complete backup tool is the full restore. As part of the backup process there is a file with the list of all files per directory. We are going to use those files to restore all the newest files from the backup sets. It might be the case that we need to restore the newest files but given an older list file (maybe because we delete some information we need to restore), in that case we set this variable. set sourceFilesDir=<path where source LST files will be taken in a restore process> if the variable is not set, the script looks for the newest backup set to be used as base for the LST files. rem get newest lst files if NOT exist "%sourceFilesDir%" ( FOR /F "usebackq delims==" %%i IN (`dir /oen/b/ad %backupDir%`) do ( set sourceFilesDir=%backupDir%\%%i ) ) Of course, all this is after setting main variables. Next thing is to retrieve all backup sets by date in descending order. FOR /F "usebackq delims

RestoreAll.cmd - Simple scripts for Backup in Windows using MSDOS

Ok, we have just restore the newest version of the file we need form all backup sets, but it was not the one we were looking for. In this case we need to validate maybe the previous version. This script restores all available files. Actually the script is the same as RestoreNewest, but with an extra directory in the RAR command. if "!process!"=="1" ( "%rarPath%\rar.exe" x -o+ "%backupDir%\%%i\%%x" "%processfile%" %restoreDir%\ %%i \ >> %restoreDir%\Restore.log ) The usage is: D:\>RestoreAll.cmd local* Where local* is the file name we are looking for. The file can contain wildcards.

RestoreNewest.cmd - Simple scripts for Backup in Windows using MSDOS

Similar to the functionality of ListBackup, but in this case we only restore the newest file. Basically, it takes all backup sets, order the sets by date in a descendant manner, and then extract the required files from all available backups without overwriting. As we first process the newest backup set, we assure that the newest file is restored. Most of the script is similar to ListBackup.cmd bun in this case we restore the contents mnot only list it. For the restore, we ser a new variable: set restoreDir=%restoreDrive%Restore_.%backupExt% In this case the command is: if "!process!"=="1" ( "%rarPath%\rar.exe" x -o- "%backupDir%\%%i\%%x" "%processfile%" %restoreDir%\ >> %restoreDir%\Restore.log ) The new switch for WinRAR is o- Do not overwrite existing files The usage is: D:\>RestoreNewest.cmd local* Where local* is the file name we are looking for. The file can contain wildcards.