Menu

Client script after Clone

Help
authkey
2013-01-14
2013-06-01
  • authkey

    authkey - 2013-01-14

    Hello,

    I am trying to run a script after my clonezilla server is done restoring a set of computers. The image I am using is a Fedora 14 build and I am attempting to have yum install packages and have user profiles edited. I have tried using the -o1 switch but have realized that the changes are only reflected on the actual Clonezilla server and not on the restored clients. I then attempted to put test arguemnts into the /opt/drbl/sbin/drbl-ocs string as per the FAQ

    Is it possible to run a script on the client after Clonezilla finishes cloning ?

    Yes, but not from /opt/drbl/sbin/dcs. You have to use /opt/drbl/sbin/drbl-ocs like this:
    /opt/drbl/sbin/drbl-ocs -l 0 startdisk restore -p "mount -t ntfs /dev/hda1 /mnt; chntpwd...; reboot -f -n"
    For more info, check "/opt/drbl/sbin/drbl-ocs --help".

    When running the following arguemnts, clonezilla fails to start the cloning operation and therefore will not run.

    /opt/drbl/sbin/drbl-ocs -b -g auto -e1 auto -e2 -x -r -j2 -p "mount /dev/sda1 /mnt; mount /dev/mapper/VolGroup-lv_home /mnt; cd /home/student/Desktop; touch file; reboot --clients-to-wait 1 -l en_US.UTF-8 startdisk multicast_restore Fedora14-GX960-img sda

    This is only a basic string but I would like to start from somewhere and then attempt the more complicated task of getting my full script to run. Is there not a way for clonezilla to run scripts on the cloned clients from a script file similar to the functionality of the -o1 switch?
    Hope someone can help me out. Thanks!
    -auth

     
  • Steven Shiau

    Steven Shiau - 2013-01-16

    "Is there not a way for clonezilla to run scripts on the cloned clients from a script file similar to the functionality of the -o1 switch? " -> What did you mean by that?
    Could you please describe more?
    Thanks.

    Steven.

     
  • authkey

    authkey - 2013-02-03

    Sorry for the late reply.

    Say for example I would like to copy files from the clonezilla server. Is there anyway for clonezilla to pass arguments from the server > client connection during or immediately after the clone?

    Thanks!

     
  • Jazz Yao-Tsung Wang

    You can put the script you need in /opt/drbl/share/ocs/postrun
    For more information, please check
    http://drbl.sourceforge.net/faq/fine-print.php?path=./2_System/31_prerun_postrun_not_working.faq#31_prerun_postrun_not_working.faq

     
    • authkey

      authkey - 2013-05-29

      Doing this results in running the script locally on the server but will not run the script on the client. For example:

      #!/bin/bash
      mount /dev/mapper/VolGroup-lv_home /
      cd /home/user/Desktop/
      touch test_file

      Will cause the 'test_file' to be created on the CZ server's ~/user/Desktop, as opposed to the clients ~/user/Desktop.

       
  • Steven Shiau

    Steven Shiau - 2013-06-01

    @authkey,
    So what was your question?
    Or anything is fine there?

    Steven.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.