Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Batch File for Backup MyPC

    I use Backup MyPc to perform differential backups on a daily basis. Currently the backup job is scheduled for each day. What I would like to do is schedule a batch file to run the backup software with the respective backup job (in this case XP_01_Wed). My difficulty is with the backup job. I can not locate the job file.

    Utlimately the batch file would backup, create a file called "Diff.xxx" and rename the "DIff.xxx" file with the current date stamp. I can rename the file without any issues.

    Any assistance would be appreicated.
    John
    Attached Images Attached Images

  2. #2
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File for Backup MyPC

    I found the backup up job. I was over looking the obvious: C:WindowsTasks"

    Thanks anyway,
    John

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File for Backup MyPC

    Is there a line of script that will wait for the scheduled task to complete prior to going on to the next line of a batch file?

    The first line of code in the batch file is: schtask /run /nt "name of task"

    Thanks,
    John

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Batch File for Backup MyPC

    Where is JohnGray, batchmaster extraordinaire?

    I think there is a separate "DOS" command that you can prepend to an existing command that essentially manages that, but I can't think of the name!

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File for Backup MyPC

    I tried using: start /wait schtask /run /nt "name of task"

    The lines of code continue to be read without a wait (wait until the schtask has finished).

    John

  6. #6
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File for Backup MyPC

    How about scheduling the calling BATch file rather than the backup job?

    @echo off
    echo %~n0: just about to CALL the Backup Task
    call dobackup.bat
    echo %~n0: executing statement after returning from the Backup Task

    I'm not sure what you want to do before and/or after the backup, but that should give you an idea or two!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  7. #7
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File for Backup MyPC

    John,

    The first line of code runs the backup program and the second line of code renames the backup file generated. Each line of code works just fine by itself. The issue is when I put them together in a batch file. The backup program kicks off and the next line of code is immediately executed and fails. It fails to the point where it can not locate the backup file ie can not rename it because it does not exist.

    I tried your recommendation and I am still encountering the same issue previously mentioned.

    John
    Attached Images Attached Images

  8. #8
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File for Backup MyPC

    Perhaps I should have been a bit more explicit, and suggested that the "backup task" stops being a scheduled task, but becomes just another BATch file (or perhaps even just a CALL to whatever executable is required)?

    Probably what is happening is that the backup task is STARTed, and so gets executed in a separate command processor, not a child command processor.

    Since I'm not familiar with the backup program, I can't say what it does. Particulalry I don't know what (or why) SCHTASK does. Does that SCHedule a TASK to do the backup?

    You could try using the START command (see START /? for syntax and parameters, particularly WAIT)...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  9. #9
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File for Backup MyPC

    John,

    I previously attached a screenshot (in the first part of this thread) that shows the program path and executable file (for the backup job) as well as the path to the backup job.

    I tried using this code: start D:appsstompbackup mypcsystembestart.exe "C:windowstasksxp_01.job" in a batch file but can not get it to function.

    John

  10. #10
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File for Backup MyPC

    > start D:appsstompbackup mypcsystembestart.exe "C:windowstasksxp_01.job"

    START knows nothing about .JOB files.

    Try a variant on

    start "" /wait "D:appsstompbackup mypcsystembestart.exe"

    (the null title can be replaced by text, such as "my backup job", but even in XP there seems to be a need to have something there!)

    or just use

    "D:appsstompbackup mypcsystembestart.exe"

    You need the quotes because there is a blank in the path.

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  11. #11
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File for Backup MyPC

    If what's been suggested so far (which really requires that you can run BESTART using command line parameters) does not work, then we need to take a different approach!

    This would be to follow the command which starts the backup with code to check that, as soon as the backup file has been created, it is detected and renamed. Let me know if you want me to write about ten lines of code for you!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  12. #12
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File for Backup MyPC

    John,

    I'll take you up on your offer for the 10 lines of code. I'm a novice at batch file commands.

    Thanks for the holiday treat.
    John

  13. #13
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Batch File for Backup MyPC

    I've just had second thoughts, because, of course, the backup file will probably be created immediately the backup job starts, and gradually filled up, then closed. Unfortunately REName seems to work quite happily even when the file is open, to my surprise.

    So that way won't work...

    So back to running with command line parameters, perhaps?

    Sorry...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  14. #14
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Batch File for Backup MyPC

    John,

    No need to be sorry. Who would think something so simple would turn out to be such a challenge.

    Unlike the line of code, I'll have to /wait as persistance pays off.

    John

  15. #15
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Batch File for Backup MyPC

    While you wait, maybe see if KiXtart will handle this problem (i.e., the problem of monitoring the completion of another process).

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •