Bash Infinite Loop

Bash infinite loop

#!/bin/bash while : do echo “Press [CTRL+C] to stop..” sleep 1 done This is a loop that will forever print “Press [CTRL+C] to stop..”. Please note that : is the null command. The null command does nothing and its exit status is always set to true. You can modify the above as follows to improve the readability:

#!/bin/bash while true do echo “Press [CTRL+C] to stop..” sleep 1 done A single-line bash infinite while loop syntax is as follows:

[Read more]

Export an Iscsi Target With Linux

Export an iSCSI Target with linux

As some already know I work voluntarily at the realcomputer e.V. We have got a Bladecenter, unfortunately without hard drives so I try with another linux machine to export a few iSCSI targets to provide the blades with some storage.

Because there are no exact specifications I use as usual debian.

install the necesary packages..

apt-get install iscsitarget

set „ISCSITARGET_ENABLE“ to true in the file /etc/default/iscsitarget.

[Read more]

Hetzner Storage Box Iscsi Export

Hetzner Storage box iSCSI export

Just a note on the side. If you are using the Hetzner Storage boxes you can use iSCSI to export them to other servers, even accross the internet thru a vpn. performance would no be that greate but it works.

based on my iSCSI howto i just unmounted my /backup dir and mounted the Storagebox instead and it all worked like a charm..

root@atlas01 /var/log # df -h /backup/ Filesystem Size Used Avail Use% Mounted on //u147976.your-storagebox.de/backup 100G 220K 100G 1% /backup root@atlas01 /var/log mount |grep backup//u157976.your-storagebox.de/backup on /backup type cifs (rw,relatime,vers=1.0,cache=strict,username=u157976,domain=PUBLICBACKUP286,uid=0,noforceuid,gid=0,noforcegid,addr=2a01:04f8:0b16:3000:0000:0000:0000:0067,unix,posixpaths,serverino,acl,rsize=1048576,wsize=65536,actimeo=1) root@atlas01 /var/log #

[Read more]