Solved my backup script using robocopy

Hynt

New member
Local time
6:56 PM
Messages
28
Location
Hofors
robocopy /S /E /MOV %USERPROFILE%\Documents\ G:\backup\Documents\
robocopy /S /E /MOV %USERPROFILE%\Pictures\ G:\backup\Pictures\
robocopy /S /E /MOV %USERPROFILE%\Downloads\ G:\backup\DownloadS\
robocopy /S /E /MOV %USERPROFILE%\Favorites\ G:\backup\Favorites\
robocopy /S /E /MOV %USERPROFILE%\Desktop\ G:\backup\Desktop\
robocopy /S /E /MOv %USERPROFILE%\Music\ G:\backup\Music\

rmdir /S /Q %USERPROFILE%\Documents\
rmdir /S /Q %USERPROFILE%\Pictures\
rmdir /S /Q %USERPROFILE%\Downloads\
rmdir /S /Q %USERPROFILE%\Music\
rmdir /S /Q %USERPROFILE%\Favorites\
rmdir /S /Q %USERPROFILE%\Desktop\
mkdir %USERPROFILE%\Documents
mkdir %USERPROFILE%\Pictures
mkdir %USERPROFILE%\Downloads
mkdir %USERPROFILE%\Music
mkdir %USERPROFILE%\Favorites
mkdir %USERPROFILE%\Desktop
 

My Computer

Computer type
Laptop
OS
Windows 7 ultimate 32bit
Memory
8GB
Screen Resolution
1024x768
Antivirus
Eset nod32
Browser
Firefox
think this works better...
echo.
echo ******************************
echo *** Robocopy Backup Script ***
echo ******************************
echo.
Robocopy /MOVE /S /E %USERPROFILE%\Documents\ G:\backup\Documents\ /e /np /tee /mt:4 /log:my_backup_log.txt
Robocopy /MOVE /S /E %USERPROFILE%\Pictures\ G:\backup\Pictures\ /e /np /tee /mt:4 /log+:my_backup_log.txt
Robocopy /MOVE /S /E %USERPROFILE%\Downloads\ G:\backup\DownloadS\ /e /np /tee /mt:4 /log+:my_backup_log.txt
Robocopy /MOVE /S /E %USERPROFILE%\Desktop\ G:\backup\Desktop\ /e /np /tee /mt:4 /log+:my_backup_log.txt
Robocopy /MOVE /S /E %USERPROFILE%\Music\ G:\backup\Music\ /e /np /tee /mt:4 /log+:my_backup_log.txt
Robocopy /MOVE /S /E %USERPROFILE%\Favorites\ G:\backup\Favorites\ /e /np /tee /mt:4 /log+:my_backup_log.txt

rmdir /S /Q %USERPROFILE%\Documents\
rmdir /S /Q %USERPROFILE%\Pictures\
rmdir /S /Q %USERPROFILE%\Downloads\
rmdir /S /Q %USERPROFILE%\Music\
rmdir /S /Q %USERPROFILE%\Favorites\
rmdir /S /Q %USERPROFILE%\Desktop\
mkdir %USERPROFILE%\Desktop
mkdir %USERPROFILE%\Documents
mkdir %USERPROFILE%\Pictures
mkdir %USERPROFILE%\Downloads
mkdir %USERPROFILE%\Music
mkdir %USERPROFILE%\Favorites
pause
 
Last edited:

My Computer

Computer type
Laptop
OS
Windows 7 ultimate 32bit
Memory
8GB
Screen Resolution
1024x768
Antivirus
Eset nod32
Browser
Firefox
Needs to add documentation (; move data to G: )
As I understood:
- You move data to G:
- You delete the user data folder
- You create new user data folder

So if, for any reason, it can't move data to G: all user data will be erased?
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    custom build
    OS
    Windows 7 HP 64
    CPU
    i5 6600K - 800MHz to 4200MHz
    Motherboard
    GA-Z170-HD3P
    Memory
    4+4G GSkill DDR4 3000
    Graphics Card(s)
    IG - Intel 530
    Monitor(s) Displays
    Samsung 226BW
    Screen Resolution
    1680x1050
    Hard Drives
    (1) -1 SM951 – 128GB M.2 AHCI PCIe SSD drive for Windows 7 and Lubuntu
    (2) -1 WD SATA 3 - 1T for Data
    (3) -1 WD SATA 3 - 1T for backup
    PSU
    Thermaltake 450W TR2 gold
    Keyboard
    Old and good Chicony mechanical keyboard
    Mouse
    Logitech mX performance - 9 buttons (had to disable some)
    Internet Speed
    500Mb/s
    Browser
    Firefox 64
    Other Info
    TinyWall firewall
  • Computer type
    Laptop
    System Manufacturer/Model Number
    Asus Q550LF
    OS
    Windows 7 Pro
    CPU
    i7-4500U 800MHz to 3.0GHz
    Motherboard
    Asus Q550LF
    Memory
    (4+4)G DDR3 1600
    Graphics Card(s)
    IG intel 4400 + NVIDIA GeForce GT 745M
    Sound Card
    Realtek
    Monitor(s) Displays
    LG Display LP156WF4-SPH1
    Screen Resolution
    1920 x 1080
    Hard Drives
    BX500 120G SSD for Windows and programs +
    1T HDD for data
    Internet Speed
    500 Mb/s
    Browser
    Firefox
    Other Info
    TinyWall firewall
The first exempel had problem.
but after editing source it''s OK"..
thanks to post here on sevenforums
 

My Computer

Computer type
Laptop
OS
Windows 7 ultimate 32bit
Memory
8GB
Screen Resolution
1024x768
Antivirus
Eset nod32
Browser
Firefox
Use this script to backup user files.
It's true data on c:\ removes.
But first copy everything to g:\
 
Last edited:

My Computer

Computer type
Laptop
OS
Windows 7 ultimate 32bit
Memory
8GB
Screen Resolution
1024x768
Antivirus
Eset nod32
Browser
Firefox
Backup scripts doesn't delete source data.
As I wrote, if, for some reason, it doesn't copy to G:, you will loose all data as you delete the source data.
 

My Computers

System One System Two

  • Computer type
    PC/Desktop
    Computer Manufacturer/Model Number
    custom build
    OS
    Windows 7 HP 64
    CPU
    i5 6600K - 800MHz to 4200MHz
    Motherboard
    GA-Z170-HD3P
    Memory
    4+4G GSkill DDR4 3000
    Graphics Card(s)
    IG - Intel 530
    Monitor(s) Displays
    Samsung 226BW
    Screen Resolution
    1680x1050
    Hard Drives
    (1) -1 SM951 – 128GB M.2 AHCI PCIe SSD drive for Windows 7 and Lubuntu
    (2) -1 WD SATA 3 - 1T for Data
    (3) -1 WD SATA 3 - 1T for backup
    PSU
    Thermaltake 450W TR2 gold
    Keyboard
    Old and good Chicony mechanical keyboard
    Mouse
    Logitech mX performance - 9 buttons (had to disable some)
    Internet Speed
    500Mb/s
    Browser
    Firefox 64
    Other Info
    TinyWall firewall
  • Computer type
    Laptop
    System Manufacturer/Model Number
    Asus Q550LF
    OS
    Windows 7 Pro
    CPU
    i7-4500U 800MHz to 3.0GHz
    Motherboard
    Asus Q550LF
    Memory
    (4+4)G DDR3 1600
    Graphics Card(s)
    IG intel 4400 + NVIDIA GeForce GT 745M
    Sound Card
    Realtek
    Monitor(s) Displays
    LG Display LP156WF4-SPH1
    Screen Resolution
    1920 x 1080
    Hard Drives
    BX500 120G SSD for Windows and programs +
    1T HDD for data
    Internet Speed
    500 Mb/s
    Browser
    Firefox
    Other Info
    TinyWall firewall
Have done a small script for backup purposes because the script moves all users files and then deletes them from the c: i want to make sure that the user approves it .. feels a bit like half-time programming otherwise
 

My Computer

Computer type
Laptop
OS
Windows 7 ultimate 32bit
Memory
8GB
Screen Resolution
1024x768
Antivirus
Eset nod32
Browser
Firefox
echo.
echo ******************************
echo *** Robocopy Backup Script ***
echo ******************************
echo Disk Drivers: C:\ D:\ E:\ F:\ G:\ H:\
echo all users files "folders" are then stored
echo on the disk you enter in a folder named backup!

set /p Disk=Enter Disk Driv
echo %Disk% is selected!
CLS
Robocopy /MIR /S /E %USERPROFILE%\Documents\ backup\Documents\ /e /np /tee
Robocopy /MIR /S /E %USERPROFILE%\Pictures\ F:\backup\Pictures\ /e /np /tee
Robocopy /MIR /S /E %USERPROFILE%\Downloads\ F:\backup\DownloadS\ /e /np /tee
Robocopy /MIR /S /E %USERPROFILE%\Desktop\ F:\backup\Desktop\ /e /np /tee
Robocopy /MIR /S /E %USERPROFILE%\Music\ F:\backup\Music\ /e /np /tee
Robocopy /MIR /S /E %USERPROFILE%\Favorites\ F:\backup\Favorites\ /e /np /tee
pause>nul
goto home
 

My Computer

Computer type
Laptop
OS
Windows 7 ultimate 32bit
Memory
8GB
Screen Resolution
1024x768
Antivirus
Eset nod32
Browser
Firefox
Instead of f:\ .. %Disk%
 

My Computer

Computer type
Laptop
OS
Windows 7 ultimate 32bit
Memory
8GB
Screen Resolution
1024x768
Antivirus
Eset nod32
Browser
Firefox
Forgot to say this code don't remove source data.
 

My Computer

Computer type
Laptop
OS
Windows 7 ultimate 32bit
Memory
8GB
Screen Resolution
1024x768
Antivirus
Eset nod32
Browser
Firefox
Back
Top