Google Chrome and RamDisk. Automation, backup and auto-update

    After reading the article Wean Chrome to eat hard drives , I got the idea to use ramdisk not only for Chrome, but also for many other frequently launched applications (WinRAR, Miranda, Firefox, web server, etc.).

    I used the idea, and was very pleased with the increased speed of my laptop (1000 mb / s versus 35 mb / s!). The only thing that was required was to make an automatic backup of the changed files on the ramdisk.

    For this purpose, I decided to use nnCron. After reading the forums and all sorts of help, I wrote several scripts that automate the whole routine associated with running applications on ramdisk.

    In this article, I will only touch the Chrome browser.

    So, we use Chrome on ramdisk .

    What do we need for this?
    1) Auto-boot Chrome to ramdisk at system startup
    2) Auto-backup to the hard drive when Chrome is closed
    3) Auto-backup every hour
    4) Auto-update browser from the Internet

    We need:
    nnCron , nnBackup (be sure to register!), WinRAR , Gavotte Ramdisk , Wget , more RAM .

    First, install all of these programs. Create a ramdisk R: \.

    Then we unpack the Chrome distribution on the hard drive in D: \ BackUp \ Programs \ Chromium \ Chrome.
    Create a shortcut to the chrome.exe executable file, in which we additionally specify in the "Object" field: "R: \ Programs \ Chromium \ Chrome \ chrome.exe --user-data-dir = .. \ Profile --enable-user- scripts ”, and in the“ Working folder ”field:“ R: \ Programs \ Chromium \ Chrome ”(all without quotes).
    The shortcut is placed on the desktop and / or in the quick launch panel, in the future we will launch the browser.

    In the end, how everything should work:
    When a user logs in, nnCron will download Chrome along with the profile from the D: \ BackUp \ Programs \ Chromium folder to the ramdisk in the R: \ Programs folder. Chrome will work with ramdisk. The backup will be incremental, in D: \ BackUp.

    First script:

    #( BIG_START
    AsLoggedUser
    SingleInstance
    WatchLogon: "*"
    Action:
    SWHide
    AsService
    StartIn: "R:\Programs\nnBackup\"
    START-APPW: R:\Programs\nnBackup\nnbackup.exe sync -i D:\BackUp\Programs\Chromium -o R:\Programs\Chromium -s -c -x chrome.exe -dx cache
    START-APP: R:\Programs\nnBackup\nnbackup.exe sync -i D:\BackUp\Programs\Chromium\Chrome -o R:\Programs\Chromium\Chrome -c -m chrome.exe
    START-APP: R:\Programs\nnBackup\nnbackup.exe sync -i D:\BackUp\Programs\Chromium\Profile\Default\Cache -o R:\Programs\Chromium\Profile\Default\Cache -c
    )#


    Everything is very simple here: a) a folder with Chrome and a profile is loaded onto the ramdisk, without an executable file and cache; b) the executable file is loaded. This is done so as not to run chrome until all the files have been copied to the end; c) the cache is loaded at the end. It is copied for a long time, and we do not make sense to wait. You can immediately open pages on the Internet, the cache will load after a minute or two.

    Another feature: if we logged out and logged in again, then Chrome will not be reloaded onto the ramdisk, which will save time.

    The following script will backup profile files when Chrome closes. Incremental backup, i.e. only changed and new files are backed up: Another script that backups Chrome every hour on a screw: And the last script that updates Chrome twice a week: The update works like this:

    #( BackUp_Chromium
    AsLoggedUser
    SingleInstance
    WatchProcStop: "chrome.exe"
    Rule: PROC-EXIST: "chrome.exe" NOT
    Action:
    SWHide IdlePriority
    AsService
    StartIn: "R:\Programs\nnBackup\"
    START-APP: R:\Programs\nnBackup\nnbackup.exe sync -i R:\Programs\Chromium -o D:\BackUp\Programs\Chromium -s -ad -c -m "Bookmarks,Cookies,Current*,Extension Cookies,History,Last*,Preferences,Thumbnails,Visited Links,Web Data,*.bdic,Local State,Safe Br*,Chrome\Plugins\*.dll"
    START-APPW: R:\Programs\nnBackup\nnbackup.exe sync -i R:\Programs\Chromium\Profile\Default -o D:\BackUp\Programs\Chromium\Profile\Default -s -ad -da -c -m "Cached Theme Images\*,Extensions\*,JumpListIcons*\*,User scripts\*"
    START-APP: R:\Programs\nnBackup\nnbackup.exe sync -i R:\Programs\Chromium\Profile\Default\Cache -o D:\BackUp\Programs\Chromium\Profile\Default\Cache -ad -da -c
    )#




    #( BackUp_One_Hour
    AsLoggedUser
    SingleInstance
    Time: 0 * * * * *
    Action:
    SWHide IdlePriority
    AsService
    StartIn: "R:\Programs\nnBackup\"
    START-APP: R:\Programs\nnBackup\nnbackup.exe sync -i R:\Programs -o D:\BackUp\Programs -s -ad -c -m "Bookmarks,Cookies,Current*,Extension Cookies,History,Last*,Preferences,Thumbnails,Visited Links,Web Data,*.bdic,Local State,Safe Br*,Chromium\Chrome\Plugins\*"
    START-APPW: R:\Programs\nnBackup\nnbackup.exe sync -i R:\Programs -o D:\BackUp\Programs -s -ad -da -c -m "Chromium\*\Cached Theme Images\*,Chromium\*\Extensions\*,Chromium\*\JumpListIcons*\*,Chromium\*\User scripts\*"
    START-APP: R:\Programs\nnBackup\nnbackup.exe sync -i R:\Programs\Chromium\Profile\Default\Cache -o D:\BackUp\Programs\Chromium\Profile\Default\Cache -ad -da -c
    )#




    #( Update_Chromium
    AsLoggedUser
    SingleInstance
    Time: 0 21 * * 3,7 *
    Action:
    SWHide IdlePriority
    AsService
    StartIn: "D:\BackUp\Wget\"
    DIR-DELETE: "R:\Updates\Chromium"
    START-APPW: D:\BackUp\Wget\wget.exe build.chromium.org/buildbot/continuous/LATEST/chrome-win32.zip -P R:\Updates\Chromium\ -c --limit-rate=32k --wait=2m --tries=60
    FILE-EXIST: "R:\Updates\Chromium\chrome-win32.zip" NOT
    IF
    LOG: "D:\BackUp\Programs\update.log" "Ошибка загрузки chrome-win32.zip [%FT-CUR FT>DD.MM.YYYY/hh:mm:ss%]"
    EXIT
    THEN
    START-APPW: R:\Programs\WinRAR\WinRAR.exe t R:\Updates\Chromium\chrome-win32.zip -r -y
    ExitCodeProc 0 <>
    IF
    LOG: "D:\BackUp\Programs\update.log" "Ошибка в архиве chrome-win32.zip [%FT-CUR FT>DD.MM.YYYY/hh:mm:ss%]"
    EXIT
    THEN
    START-APPW: R:\Programs\WinRAR\WinRAR.exe x R:\Updates\Chromium\chrome-win32.zip R:\Updates\Chromium\ -y
    ExitCodeProc 0 <>
    IF
    LOG: "D:\BackUp\Programs\update.log" "Ошибка распаковки chrome-win32.zip [%FT-CUR FT>DD.MM.YYYY/hh:mm:ss%]"
    EXIT
    THEN
    PAUSE: 10000

    START-APPW: R:\Programs\nnBackup\nnbackup.exe sync -i R:\Updates\Chromium\chrome-win32 -o D:\BackUp\Programs\Chromium\Chrome -s -ad -da -c -dx Dictionaries,locales,Plugins,resources
    START-APPW: R:\Programs\nnBackup\nnbackup.exe -i R:\Updates\Chromium\chrome-win32\locales\ru.dll -o D:\BackUp\Programs\Chromium\Chrome\locales -c
    LOG: "D:\BackUp\Programs\update.log" "chrome-win32.zip [%FT-CUR FT>DD.MM.YYYY/hh:mm:ss%]"

    BEGIN PAUSE: 500 PROC-EXIST: "chrome.exe" NOT UNTIL
    BEGIN FILE-DELETE: "R:\Programs\Chromium\Chrome\chrome.exe" PAUSE: 1000 FILE-EXIST: "R:\Programs\Chromium\Chrome\chrome.exe" NOT UNTIL

    START-APPW: R:\Programs\nnBackup\nnbackup.exe sync -i R:\Updates\Chromium\chrome-win32 -o R:\Programs\Chromium\Chrome -s -ad -da -c -x chrome.exe -dx Dictionaries,locales,Plugins,resources
    START-APPW: R:\Programs\nnBackup\nnbackup.exe -i R:\Updates\Chromium\chrome-win32 -o R:\Programs\Chromium\Chrome -s -c -m chrome.exe,locales\ru.dll
    DIR-DELETE: "R:\Updates\Chromium"
    )#



    A new archive is downloaded, checked, unpacked. Files are updated in backup with saving plugins and dictionaries.
    If Chrome is currently running, the script waits until the browser is closed, after which it updates the files on the ramdisk.

    That's all!
    Edit the paths for running programs in scripts for yourself.

    Also popular now: