If you want to tar a multiple files you must write a file containing a list of file to backup and the use this command:
cat listoffiles.txt | xargs tar czvf yourbackupname.tgz - or
tar zcvf yourbackupname.tgz $(cat listoffiles.txt)
How to tar a list of files
Posted: 29th March 2010 by fabio in bash, linuxTags: backup list of files, files, multiple files, tar
0
< ?php
function ping($host) {
exec(sprintf('ping -c 1 -W 5 %s', escapeshellarg($host)), $res, $rval);
return $rval === 0;
}
$hosts_to_ping = array('127.0.0.1');
?>
< ?php foreach ($hosts_to_ping as $host): ?>
< ?php echo $host; ?>
< ?php $up = ping($host); ?>
< ?php echo $up ? 'on' : 'off'; ?>
< ?php endforeach; ?>
how to check sip channels connected for a long period
Posted: 27th November 2009 by fabio in asterisk, bash, sipTags: asterisk, channels, check, sip
If you want to verify if there are sip channels that are connected for a long period, use this script
#!/bin/bash
###########################################################
# this script chech if channel has reached limit duration
###########################################################
COUNT=`asterisk -rx "show channels verbose" |grep -v "hannel|active" |grep ^SIP |awk '{print $1" "$9}' |wc -l`
`asterisk -rx "show channels verbose" |grep -v "hannel|active" |grep ^SIP |awk '{print $1" "$9}' > /tmp/list_channel`
XLIMIT=50
IFS=$'n'
#echo "Total active calls: " $COUNT
for LINE in $( cat /tmp/list_channel ); do
CHAN=`echo $LINE | awk '{print $1}' `
TIME=`echo $LINE | awk '{print $2}' `
XTIME=`echo $LINE | awk '{print $2}' | awk -F: '{print $2}' `
if [ $XTIME -gt $XLIMIT ]
then
echo "limit reached: " $TIME
echo "CHAN: " $CHAN;
echo "TIME: " $TIME;
#echo "Hangupping call ..."
#asterisk -rx "soft hangup $CHAN"
fi
done