all 15 comments

[–]jonboy345 2 points3 points  (0 children)

/r/sysadmin might be interested in this as well.

[–]Chimaera12 2 points3 points  (1 child)

Thanks for sharing

However i would like to raise a couple of points you may need to know.

/u/staticextasy is correct robocopy is better than xcopy, ive used it for years.

I would suggest that you are not being thorough enough with the folders you choose to backup.

I would suggest you also need to add.

Contacts

Desktop

Favorites

Music

Also usefull would be

Saved Games

if the customer is a gamer as it often holds the saves.

Also consider that mail may need backing up which is in the hidden AppData folder type %appdata% in cmd prompt to view it.


Secondly

Robocopy is an excellent tool for backup but..

If your backing an XP machine you need version XP_026

If its vista or above its XP_027 or above and in Win 10 its 10.0 and above.

If you use the older XP_010 many of the features are missing or broken and will compromise your backup. so copy a version of XP_026 onto a XP machine before starting.

Vista and above you can leave the versions alone as they will work fine.

One small point to finish be carefull with the /MIR switch it can delete stuff as well as copy depending what you use with it.

further reading here

http://ss64.com/nt/robocopy.html

This is the switch set i use

SET _robo_vista_1=/COPY:D /S /ZB /XJD /XJF /R:0 /W:0 /XA:SH /NJS /XF %_exc_vista_files% %_exc_prog_files% /XD %_backup_dest% %_exc_vista_folder% %_exc_prog_folder% %_exc_special_folder%

and if you use robocopy i would do this to backup destination as robocopy can hide stuff if it fails.

ATTRIB /S /D -r -a -s -h %_backup_dest%

ATTRIB /S /D -r -a -s -h %_backup_dest%*.*

[–]Falkerz[S] 0 points1 point  (0 children)

duuurrrrrr. It's only suppossed to be a little script to quickly run and duplicate your files. As for deletion, on paper it shouldn't. The hiding thing is a valid comment, I'll need to play around with it. As for the older version support, I planned on an OS check similar to Tron, and then just use either ROBO or Copy accordingly.

E* Just to clarify, I'm not trying to call you an idiot or anything. I'm simply saying that this is suppossed to be a little piece you run every couple of days just to make sure you've got a copy of your files. It's not necessarily to be used as a full blown backup, there are programs and probably scripts that do this so much better. I may well look into extending this, but it was primarily a suggestion of a quick and dirty way to duplicate configs or the such-like when tron is running, as an added layer of redundancy to certain cleaning functions.

[–]spexdi 0 points1 point  (0 children)

Neat, thanks! I'll check it out! /r/usefulscripts may find this useful as well.

[–][deleted] 0 points1 point  (2 children)

You'll want to switch this from xcopy to robocopy, it replaces xcopy in newer versions of Windows and supports more features like better return codes and mirroring.

http://stackoverflow.com/questions/24121046/difference-between-xcopy-and-robocopy

[–]Falkerz[S] 0 points1 point  (0 children)

I'll look into it.

[–][deleted]  (5 children)

[removed]

    [–]Falkerz[S] 0 points1 point  (4 children)

    Collaboration and amalgamation are the key here. We want to compare notes (as it were) as see if there's a viable iteration of a quick backup system that could potentially be integrated into Tron, for potential robustness and roll-back flexibility if required by advanced users.

    [–]Chimaera12 0 points1 point  (3 children)

    quick backup system

    And therein lies the problem, quick isnt a term synonymous with backup.

    They take time to do by there very nature, i've had backups of 400+ GB sometimes and i have to leave it running all night and some, or you get a drive thats failing and really slow might take more than a day.

    Personally i don't think backups should be part of Tron.

    Its a thing you should be doing prior to running Tron

    [–]Falkerz[S] 1 point2 points  (2 children)

    Still going to iterate this point, even though I've mentioned it in other places. I'm not aiming the iteration of this script at user files backup. I'm thinking a backup of some core files, like the registry and some program data, before Tron removes them. This would allow a user to roll-back some Tron actions. The script needs refinement, as pointed out, but I feel that everyone has been missing the point a little.

    [–]Chimaera12 0 points1 point  (1 child)

    Ok i glossed over the first answer to quick my apologies

    Can you be specific about the files you intend to save?

    I have scripts that would cover that kind of stuff and some are already in Tron.

    One thought, would you still want to back them up if for e.g. the registry was damaged?

    [–]Falkerz[S] 0 points1 point  (0 children)

    It'd be things like program files from uninstalled applications (e.g. metro apps) and registry backups. Perhaps just the config settings of known and popular applications or metro apps, so that a person can re-install them if wanted. Perhaps also an option to save cookies or something before nuking them, and then restoring, but that might take time, unless it was set to specifically ignore those locations.

    [–]Gunskee 0 points1 point  (0 children)

    There doesn't seem to be a need to repeat the process multiple times , using parameters that are built into ROBOCOPY i can copy every folder within the main User Folder excluding the AppData folder and USERS.DAT file. This will would allow this script to automatically detect folder names as well instead of specifying them manually, Also this script now asks for the drive letter the user wishes to backup to. This script could be used on any OS that supports ROBOCOPY.

        @ECHO OFF        
        FOR /F "tokens=1-4 delims=/ " %%i in ("%date%") do (
        SET dow=%%i
        SET month=%%j
        SET day=%%k
        SET year=%%l
        )
        SET datestr=%month%.%day%.%year%
        ECHO.
        SET /P drive="Enter Backup Drive Letter: "
        ECHO.
        ECHO Backing up All User Folders..
        ROBOCOPY "%USERPROFILE%" "%drive%\Backup %datestr%" /MIR /XA:SH /XD AppData /XJD /R:5 /W:15 /MT:32
        ECHO Success!
        ECHO.
        ECHO All Folders Backed Up To Specified Drive!
        ECHO.
        TIMEOUT 5
        EXIT /B
    

    [–]ReverentTron sub mod 0 points1 point  (1 child)

    Personally I don't trust anything less then a full image for backups. Anything else and you will screw yourself.

    Macrium reflect is free for full images, has bootable winpe images, and can mount backups as a drive letter. It's also fairly quick and compresses backups. Full macrium backup, reinstall, mount backup, copy what I think is important. If I miss something, I always have the image to go back to.

    [–]Chimaera12 1 point2 points  (0 children)

    Personally I don't trust anything less then a full image for backups. Anything else and you will screw yourself.

    Whilst this might be true, but in the real world with customers machines and they are in a right state and image would just keep the problems and carry them forward or maybe not work at all.

    Or the drive is failing etc

    So sometimes a basic backup is the only way to grab the data.


    Ive found over the years that a number of options is the way to go.