This script will start a scrub on each ZFS pool (one at a time) and will send an e-mail or display the result when everyting is completed. I wrote this script to launch each scrub one after the other and a summary by e-mail that can tell me how much time it took to each ZFS scrub.
Posts under ‘bash’
Useful tools in an “embedded” FreeNAS: wget and bash
wget
To install wget on a “data” parition:
export PKG_TMPDIR=/mnt/usb-data/temp
pkg_add -r wget -P /mnt/usb-data/pkg
Now we need a script to create the symlinks to the wget binaries in the “pkg” directory:
nano /mnt/usb-data/hooks.sh
Here’s the content:
#!/bin/sh
ln -s /mnt/usb-data/pkg/bin/wget /bin/wget
Now make it run at boot time, go in System —> Advanced —> Command scripts and enter:
/mnt/usb-data/hooks.sh
Select PostInit and that’s it! Everytime [...]
Vim (Vi IMproved) in an “embedded” FreeNAS
You need an embedded install with a data partition. My FreeNAS server runs from a 1GB usb stick and the data partition is mounted as “/mnt/usb-data”. To install Vim on the usb stick:
# using csh
setenv PKG_TMPDIR /mnt/usb-data/temp
# install package
pkg_add -r vim-lite -P /mnt/usb-data/pkg
Now we need a script to create the symlinks to the Vim binaries [...]
Ubuntu: ethtool permanent 1000baseTX full-duplex
vi /etc/init.d/1000Mbs
#!/bin/sh
ETHTOOL="/usr/sbin/ethtool"
DEV="eth0"
case "$1" in
start)
echo -n "Setting eth0 speed 1000 full-duplex…";
$ETHTOOL -s $DEV speed 1000 duplex full autoneg on;
echo " done."
[...]
Windows Backup using rsync and DeltaCopy
Use DeltaCopy (as rsync server) on the Windows box:
http://www.aboutmyip.com/AboutMyXApp/DeltaCopy.jsp
You’ll need to open port TCT/873 in your windows firewall.
Note: To fix the accentuated characters issue in the filenames, you can replace the “Cygwin1.dll” in the DeltaCopy directory by a UTF-8 compliant Cygwin dll (http://www.okisoft.co.jp/esc/utf8-cygwin/). Then restart the service or reboot.
And here’s my bash script running on [...]

