试图重定向“的git gc的'输出 [英] Trying to redirect 'git gc' output

查看:95
本文介绍了试图重定向“的git gc的'输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在那上的所有回购运行 git的GC crontab的一个 @daily 工作。
我试图建立一个日志文件的工作,但I / O重定向不会产生我在寻找的结果;我得到一个空白文件。

I have a @daily job in the crontab that runs git gc on all the repos. I'm trying to set up a log file for the job but I/O redirection does not produce the results I am looking for; I get a blank file.

我已经做了所有常用的> 2 - ;&放大器; 1 等没有任何成功。

I've done all the usual >, 2>&1 and so on without any success.

向我提到, git的GC ncurses的使用为其抛出直接输出到控制台输出的程序,从而绕过标准输出/标准错误(纠正我,如果我错了,有人这里)。

Someone mentioned to me that git gc uses ncurses for its output procedures which throws output directly to the console, thus bypassing stdout/stderr (correct me if I'm wrong here).

有人能指出我在正确的方向?

Can some one point me in the right direction?

推荐答案

您可以试试这个:

脚本-q -c'混帐GC'>日志

还是这个(与更具可读性输出):

Or this (with more readable output):

脚本-q -c'混帐GC| SED的/ \\ R * //克'>日志

这篇关于试图重定向“的git gc的'输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆