Scheduler for update database ASP.net

  1. Buat sebuah batch file ekstensi (.bat) untuk membuka URL tanpa membuka browser, cara membuatnya bisa melalui notepad dg mengetikkan script berikut “callurl <alamatUrl-backupdata>” misal : callurl http://localhost:1867/BackupDatabase/Backup
  2. Buat semual file ekstensi (.cmd) melalui notepad dg mengetikkan script berikut ini :
    @if (@This==@IsBatch) @then
    @echo off
    rem **** batch zone *********************************************************
    
        setlocal enableextensions disabledelayedexpansion
    
        rem Batch file will delegate all the work to the script engine 
        if not "%~1"=="" (
            wscript //E:JScript "%~dpnx0" %1
        )
    
        rem End of batch area. Ensure batch ends execution before reaching
        rem javascript zone
        exit /b
    
    @end
    // **** Javascript zone *****************************************************
    // Instantiate the needed component to make url queries
    var http = WScript.CreateObject('Msxml2.XMLHTTP.6.0');
    
    // Retrieve the url parameter
    var url = WScript.Arguments.Item(0)
    
        // Make the request
    
        http.open("GET", url, false);
        http.send();
    
        // All done. Exit
        WScript.Quit(0);
  3. simpan dalam satu folder bersama file backup (.bat) yang sudah anda buat pada point pertama.
    13901608_1433956339964863_230691031_o
  4. setelah itu masuk ke windows scheduler, untuk lebih gampangnya ketikkan di search/run “Task Scheduler”
    Kemudian pilih Create Basic Task
    13898581_1433963949964102_2118792632_o
  5. Kemudian Pilih waktu schedulernya
    13901946_1433959063297924_1589074633_o
  6. Kemudian Settinga Jam Schedulernya
    13681988_1433959206631243_1559251574_o
  7. Pilih Action yang ingin dilakukan.
    13662632_1433959356631228_168482527_o
  8. Pilih direktori program yg ingin dijalankan dalam hal ini pilih program yang sudah anda buat tadi yang bereksstensi (.bat)
    13835760_1433959666631197_1473789034_o
  9. Kemudian Finish
  10. Secara Otomatis Backup data akan dilakukans ecara otomatis sesuai setting jam yang anda buat

Irwan Saifranto has written 1 article

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>