I'm trying to check if a scan of an Accumulo table times out (to see if the table is corrupted).
#!/bin/bash
timeout -s KILL 20s accumulo shell -zi myInstance -u root -p secret -e "scan -np -t myTable"
if [ $? -eq 0 ]; then
echo 'Scan successful'
else
echo 'Scan timed out'
fi
The script runs the full 20 seconds and doesn't execute the accumulo shell
command, and also returns a 0 exit status incorrectly.
If I run the above timeout command in a terminal the command runs as expected.
If I run a basic timeout command (e.g. timeout -s KILL 20s sleep 10
) in the script or in a terminal, that works as well. So for some reason the combination of a timeout and accumulo shell
command in a bash script does not work.
- Accumulo version: 1.6.0-cdh4.6.0
- OS version: CentOS 6.6