我正在使用GNU parallel在几个不同的服务器(最多25个)上运行一个作业.
实现此目的的shell脚本当前执行:
parallel --tag --nonall -S $some_list_of_servers "some_command"
state=$?
echo -n "RESULT: "
if [ "$state" -eq "0" ]
then
echo "All jobs successful"
else
echo "$state jobs failed"
fi
return $state
Run Code Online (Sandbox Code Playgroud)
其中some_list_of_servers是一个数组,而install_command例如是git fetch.
我想要的是更多的信息,而不仅仅是失败的工作量.我想知道哪个命令和哪个服务器失败了.
我已经浏览了手册页,谷歌和SO,但找不到我正在寻找的开关.
任何帮助感激不尽.
WeeDom
编辑回答答案1:
我试过了,发生了一些奇怪的事情.
weedom@host1: ~/$ parallel --tag --nonall -j8 --joblog test.log -S host1,host2 uptime
host2 10:41:17 up 36 days, 20:45, 1 user, load average: 0.00, 0.00, 0.00
host1 10:41:17 up 22:34, 3 users, load average: 0.06, 0.11, 0.04
weedom@host1: ~/$ cat test.log …Run Code Online (Sandbox Code Playgroud) 每当cron运行自动续订我的客户端订阅时,我都会在错误日志中收到此信息.
[Wed Nov 22 06:45:01 2017] [error] [client 204.187.12.186] FastCGI: server "/php-completehumanperformancecom.fpm" stderr: Stack trace:, referer: http://completehumanperformance.com/wp-cron.php?doing_wp_cron=1511361900.1951580047607421875000
[Wed Nov 22 06:45:01 2017] [error] [client 204.187.12.186] FastCGI: server "/php-completehumanperformancecom.fpm" stderr: #0 [internal function]: WC_Subscriptions_Payment_Gateways::gateway_scheduled_subscription_payment(), referer: http://completehumanperformance.com/wp-cron.php?doing_wp_cron=1511361900.1951580047607421875000
[Wed Nov 22 06:45:01 2017] [error] [client 204.187.12.186] FastCGI: server "/php-completehumanperformancecom.fpm" stderr: #1 /var/home/hybrid/completehumanperformance.com/www/wp-includes/class-wp-hook.php(298): call_user_func_array('WC_Subscription...', Array), referer: http://completehumanperformance.com/wp-cron.php?doing_wp_cron=1511361900.1951580047607421875000
[Wed Nov 22 06:45:01 2017] [error] [client 204.187.12.186] FastCGI: server "/php-completehumanperformancecom.fpm" stderr: #2 /var/home/hybrid/completehumanperformance.com/www/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array), referer: http://completehumanperformance.com/wp-cron.php?doing_wp_cron=1511361900.1951580047607421875000
[Wed Nov 22 06:45:01 2017] [error] [client 204.187.12.186] FastCGI: …Run Code Online (Sandbox Code Playgroud)