Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Backup Question

  • 09-04-2008 12:54pm
    #1
    Closed Accounts Posts: 20


    Hi All

    My sister has a little office, consisting of 2 PC's and a broadbandrouter for connectivity and web access.
    She has an external HDD also which she has never used and wants to back up her information to this. It's an 80gig HDD and the info she needs backed up every day is 190mb only.

    I was going to write a one line batch file something like this

    xcopy source destination /e /f /c /y

    and schedule it to run every day in the control panel while she is at lunch and she seems happy with that.

    My question is though can I create another batch file which I can run monthly to save a monthly backup. Basically create a folder called May 08 and do the copy but next month create a folder called June 08 and do the copy.

    How do I get the batch file to update itself with the new monthly folder names or would I be better off using some freeware app.

    Thanks


Comments

  • Closed Accounts Posts: 20 corkman80


    Got it sorted. Have a batch file I can run every month which creates a directory with the date of the backup which will solve my issue.

    Here is an example

    @echo off
    :: variables
    set drive=d:\Backup
    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
    SET date="%date:~0,2%-%date:~3,2%-%date:~8,2%"

    echo ### Backing up Test Directory...
    %backupcmd% c:\testing "%drive%\%date%\"


  • Registered Users, Registered Users 2 Posts: 8,423 ✭✭✭Gadgetman496


    corkman80 wrote: »
    Got it sorted. Have a batch file I can run every month which creates a directory with the date of the backup which will solve my issue.

    Here is an example

    @echo off
    :: variables
    set drive=d:\Backup
    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
    SET date="%date:~0,2%-%date:~3,2%-%date:~8,2%"

    echo ### Backing up Test Directory...
    %backupcmd% c:\testing "%drive%\%date%\"

    That's a handy little batch file :)

    "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid."



  • Registered Users, Registered Users 2 Posts: 833 ✭✭✭batman2000


    Wow that look like a very small file but useful...How can I get this to work on my laptop to copy "My documents" to an external hdd?


  • Registered Users, Registered Users 2 Posts: 8,423 ✭✭✭Gadgetman496


    batman2000 wrote: »
    Wow that look like a very small file but useful...How can I get this to work on my laptop to copy "My documents" to an external hdd?

    Create a new txt file on your Desktop & save it as backup.bat

    Right click the file & choose edit

    Copy & paste the following lines into it.

    @echo off
    :: variables

    REM This is the location where your backup will be stored.
    set drive=D:\Backup

    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
    SET date="%date:~0,2%-%date:~3,2%-%date:~8,2%"

    echo ### Backing up Directory...

    REM This is the folder you want backed up.
    %backupcmd% C:\Documents and Settings\Your Name\My Documents "%drive%\%date%\"


    Change the bits in RED to suit your needs.

    Save the file.

    Everytime you run the file (Double click it) it will create a new directory on the drive you have chosen to store your backup, this directory will be called "Backup" & it will have a sub directory with the date as its name which will contain your "My Documents"

    You can also use windows scheduler to run the file automatically for you if you want.


    -

    "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid."



  • Registered Users, Registered Users 2 Posts: 3,420 ✭✭✭Dinarius


    Hi guys,

    PC/Windows XP Pro.

    I've been using the program Second Copy to back up images (I'm a professional photographer) to external HDs.

    Lately, it has starting doing something odd - it makes copies of some files (usually only a handful) in the destination folder and dumps the originals in the Recycly Bin.

    It is driving me nuts as it also takes a lot longer to do the task now - it should only be copying across new files from the source folder and no other files, but I'm having my doubts.

    Could I use the above code? If so, I'd need to be told exactly what to do! :o

    Alternatively, what could I use instead of Second Copy?

    I have 3 x 500Gb drives on my desktop. One, the C drive contains all the usual stuff plus edited images. A second contains RAW files and a third contains Digital Negtives (.dng files). Each is pointed to a different external HD.

    That's it.

    Thanks.

    D.


  • Advertisement
  • Closed Accounts Posts: 20 corkman80


    Dinarius wrote: »
    Hi guys,

    PC/Windows XP Pro.

    I've been using the program Second Copy to back up images (I'm a professional photographer) to external HDs.

    Lately, it has starting doing something odd - it makes copies of some files (usually only a handful) in the destination folder and dumps the originals in the Recycly Bin.

    It is driving me nuts as it also takes a lot longer to do the task now - it should only be copying across new files from the source folder and no other files, but I'm having my doubts.

    Could I use the above code? If so, I'd need to be told exactly what to do! :o

    Alternatively, what could I use instead of Second Copy?

    I have 3 x 500Gb drives on my desktop. One, the C drive contains all the usual stuff plus edited images. A second contains RAW files and a third contains Digital Negtives (.dng files). Each is pointed to a different external HD.

    That's it.

    Thanks.

    D.

    You can use the below. All you need to do is change the 3 exthdd\cdrivebackup bits to the path of your 3 external hdd's, eg: g:\backup, h:\backup etc.

    Copy and paste it into a text file and save the text file as a .bat instead of.txt.

    Make sure your external hdd's are plugged in and off you go.
    The first time you run it it will take a while and copy everything, the subsequent times it will copy changes and new files.
    You dont really need a file that creates different folders, copying changes to one folder should suffice

    @echo off
    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y

    echo ### Backing up The Drives...
    %backupcmd% c:\mypics exthdd\cdrivebackup
    %backupcmd% d:\mypics exthdd\cdrivebackup
    %backupcmd% e:\mypics exthdd\cdrivebackup


  • Registered Users, Registered Users 2 Posts: 833 ✭✭✭batman2000


    Thanks very much..a very handy file....

    I presume I can change the backup file from

    %backupcmd% C:\Documents and Settings\Your Name\My Documents "%drive%\%date%\"

    to

    %backupcmd% C:\Documents "%drive%\%date%\"


    assuming of course I have a file called "Documents"


    Thanks
    Create a new txt file on your Desktop & save it as backup.bat

    Right click the file & choose edit

    Copy & paste the following lines into it.

    @echo off
    :: variables

    REM This is the location where your backup will be stored.
    set drive=D:\Backup

    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
    SET date="%date:~0,2%-%date:~3,2%-%date:~8,2%"

    echo ### Backing up Directory...

    REM This is the folder you want backed up.
    %backupcmd% C:\Documents and Settings\Your Name\My Documents "%drive%\%date%\"


    Change the bits in RED to suit your needs.

    Save the file.

    Everytime you run the file (Double click it) it will create a new directory on the drive you have chosen to store your backup, this directory will be called "Backup" & it will have a sub directory with the date as its name which will contain your "My Documents"

    You can also use windows scheduler to run the file automatically for you if you want.


    -


  • Registered Users, Registered Users 2 Posts: 120 ✭✭p2kone


    give synctoy a go!


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    wow i don't have a lot of experience in .bat files but christ they look 100 times more complicated than achieving the equivilant in a unix environment.


  • Registered Users, Registered Users 2 Posts: 8,423 ✭✭✭Gadgetman496


    Dinarius wrote: »
    Hi guys,

    PC/Windows XP Pro.

    I've been using the program Second Copy to back up images (I'm a professional photographer) to external HDs.

    Lately, it has starting doing something odd - it makes copies of some files (usually only a handful) in the destination folder and dumps the originals in the Recycly Bin.

    It is driving me nuts as it also takes a lot longer to do the task now - it should only be copying across new files from the source folder and no other files, but I'm having my doubts.

    Could I use the above code? If so, I'd need to be told exactly what to do! :o

    Alternatively, what could I use instead of Second Copy?

    I have 3 x 500Gb drives on my desktop. One, the C drive contains all the usual stuff plus edited images. A second contains RAW files and a third contains Digital Negtives (.dng files). Each is pointed to a different external HD.

    That's it.

    Thanks.

    D.

    Allway Sync is another very good one too


    -

    "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid."



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 8,423 ✭✭✭Gadgetman496


    Cremo wrote: »
    wow i don't have a lot of experience in .bat files but christ they look 100 times more complicated than achieving the equivilant in a unix environment.

    They do don't they :D

    For example, this is the same Batch file but with a bit of interaction :)

    @echo off
    cls
    REM ************************************************
    REM ** The next section includes user interaction **
    REM ************************************************


    set input=
    set /p input=Commence Backup y or n
    if %input%==y goto a
    if %input%==n goto b

    :a
    :: variables

    REM This is the location where your backup will be stored.
    set drive=D:\Backup

    REM This is the actual backup command with date included.
    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y
    SET date="%date:~0,2%-%date:~3,2%-%date:~8,2%"

    REM This is the folder you want backed up.
    %backupcmd% c:\Albert "%drive%\%date%\"

    echo Backup Complete...

    pause

    :b
    exit



    -

    "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid."



  • Registered Users, Registered Users 2 Posts: 833 ✭✭✭batman2000


    As you may guess, I have very little (okay none!) experience in writing batch files..what does the line
    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y actually copy. Is it searching to copy the S:\, C:\, D:\?? :confused:


  • Registered Users, Registered Users 2 Posts: 8,423 ✭✭✭Gadgetman496


    batman2000 wrote: »
    As you may guess, I have very little (okay none!) experience in writing batch files..what does the line
    set backupcmd=xcopy /s /c /d /e /h /i /r /k /y actually copy. Is it searching to copy the S:\, C:\, D:\?? :confused:


    They are the switches that tell it to search for files that have been changed since last backup or files that have been added or removed & so on.

    For example, if you had a text file with a phone number that was going to remain the same, those switches tell the batch file that this file has not been modified since the last time it checked it.

    That's the basics of it but I might not have explained totally for you.

    -

    "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid."



  • Registered Users, Registered Users 2 Posts: 8,423 ✭✭✭Gadgetman496


    This will give you a breakdown of the switch commands:

    http://www.ahuka.com/backup/backup3.html

    -

    "Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid."



  • Moderators, Education Moderators, Technology & Internet Moderators Posts: 35,125 Mod ✭✭✭✭AlmightyCushion


    Will this work in all versions of windows?


  • Registered Users, Registered Users 2 Posts: 26,584 ✭✭✭✭Creamy Goodness


    Will this work in all versions of windows?
    as long as it has access to command prompt i'm sure it will.


Advertisement