Hi Guys,
I want to write some rsync scripts that will run using cron. I have found the drive OS has limited cmds. I need to install expect & tcl. Does anyone know how to get round this?
Many thanks
Ian
Hi Guys,
I want to write some rsync scripts that will run using cron. I have found the drive OS has limited cmds. I need to install expect & tcl. Does anyone know how to get round this?
Many thanks
Ian
You will need to do some scary modifications to a Gen2 system to get those.
First, you will need Fox_exe’s wdcrack package, so that you can get the init script functionality it offers. You will need this to create symbolic links in /bin /sbin, /etc, and pals for whatever additional programs you want to add to the box’s compliment. This is because the Gen2 uses a ramdisk for the root file system, and it wipes itself clean every shutdown/reboot, so changes ARE NOT PERSISTENT.
Since the ramdisk has very limited space, we dont want to copy actual files into it. Instead, we want to create symbolic links pointing to persistent storage.
After you have wdcrack set up, and have gotten familiar with how it does its init script, you will need to recompile your CLI commands from source with --static option in a suitable cross compiler (or native inside a debian chroot, like I do.)
Once you have created statically compiled binaries for your missing commands, put them into the mycloud’s persistent storage, and add appropriate symlink creation fu to the wdcrack init script. At user-init level, the mycloud will create the symlinks, and then afterwards the device’s shell will be able to make use of those commands.
This is not something you should try to undertake if you are either a novice, or if you feel you need to keep your warranty coverage. These modifications are the things that break both. Terribly.
Why not just use the chroot command. If you copy the Gen1 system to a USB drive. You can mount the
USB drive on your gen2 and chroot to it. You will then have access to all of the commands available to the gen1 on a gen2. The gen1 and gen2 My Clouds both run the 64k page size code. One needs to get familiar with using chroot. A simple test I did was to try to run fdisk on a gen2 My Cloud. So you mount the USB cd to it. Then run sbin/fdisk --help. It will fail because the libraries are not located. Then do a chroot . Now run sbin/fdisk --help it works. When you chroot to the USB device your mounts that are mounted on the gen2 before the chroot are not available after the chroot. You need to use the bind command. I was playing with chroot to see if I could get the system to run entirely off of the USB and not the HDD. If it would work it would have resolved the sleep issue. Since it dosen’t access the HDD to run most of its commands. I stopped working on this a while back. I couldn’t get some commands to stop and restart on the chroot.
a chroot has a lot of baggage, if you just want the added functionality of 2 little commands. (“expect” and “tcl” respectively.) Building them yourself with the right page size, with statically linked libraries is cleaner/lighter.
Especially if you want to use those to programatically do stuff on the mycloud, and dont want to be contained in a chroot.
Yes I have compiled a couple of programs to run on the gen2 system. They need to be compiled statically. That way the libraries that they need are included with the programs code. Recompiling is not something the average person is capable of doing. The chroot just uses code that already works.
Our guy is designing rsync automation scripts. It sounds to me like he is just asking in a round-about way if somebody can supply him with functional [expect] and [tcl], and telling him how to get them working neatly on a gen2.
He does not sound like your typical user. I would not put running a cross compiler outside his skill level so quickly.
If he has SSH/RSH working cleanly already, he might not need WDCrack. He might be able to have RSH fire off a local script he has stored on local persistent storage whenever the rsync script is run, which checks for the presence of the symlinks, and if they dont exist, create them, then continue. He would still need statically compiled expect and tcl for whatever he is planning that he needs them for.
I suppose I should have asked if he minded doing a cross compile to get the statically linked binaries he needs… But it did not sound like he was aware that he needed statically linked binaries. I also wanted him to know that WD looks dimly on running custom software on their boxes in terms or warranty coverage.
If the object is to just run a script as a certain time. One can search the forum for plink. Plink is a program that runs on a windows PC and executes commands on a Linux system.