我有incron设置和工作,我可以看到文件更改时记录的事情。 我已经单独尝试了我的rsync命令,并且工作正常。但是当由inron触发rsync时,没有任何反应。我明确说明了我能看到的所有路径。
这是我的incrontab -e
/home/dir/dir/ IN_MODIFY sudo rsync -pogr -e 'ssh -i /root/.ssh/rsasync1' /home/dir/dir/* root@ipaddress:/home/dir/dir/
我现在以root身份工作并以root身份执行命令。还尝试了/ usr / bin / rsync,除了sudo rsync等之外没有用...
谢谢!
答案 0 :(得分:0)
在incrontab中尝试:
void EckOpCam::FlatField(cv::Mat & parmI)
{
// workaround for access violation error
cv::Mat I = parmI;
const int channels = I.channels();
if (flatField.rows == 0)
MakeFlatFieldMat(I.rows);
// accept only char type matrices
ASSERT(I.depth() == CV_8U);
// make sure the matrices are the same size
ASSERT(I.cols == flatField.cols);
ASSERT(channels == flatField.channels());
// Try the really slow way...
int nRows = I.rows;
int nCols = I.cols;
unsigned int ipix0, ipix1, ipix2; // B,G,r values of pixel in I
float fpix0, fpix1,fpix2; // B,G,r values of pixel in flatField
float pix0, pix1, pix2;
switch (channels)
{
case 1:
for (int y = 0; y < nRows; ++y)
for (int x = 0; x < nCols; ++x)
{
{
ipix0 = I.at<cv::Vec3b>(x, y)[0];
fpix0 = flatField.at<cv::Vec3f>(x, y)[0];
pix0 = ipix0 * fpix0;
I.at<cv::Vec3b>(x, y)[0] = (pix0 > 255) ? 255 : uchar(pix0);
}
}
break;
case 3:
for (int y = 0; y < nRows; ++y)
for (int x = 0; x < nCols; ++x)
{
{
ipix0 = static_cast<uchar>(I.at<cv::Vec3b>(x, y)[0]); //<<< memory access error!
ipix1 = static_cast<uchar>(I.at<cv::Vec3b>(x, y)[1]);
ipix2 = static_cast<uchar>(I.at<cv::Vec3b>(x, y)[2]);
fpix0 = flatField.at<cv::Vec3f>(x, y)[0];
fpix1 = flatField.at<cv::Vec3f>(x, y)[1];
fpix2 = flatField.at<cv::Vec3f>(x, y)[2];
pix0 = ipix0 * fpix0;
pix1 = ipix1 * fpix1;
pix2 = ipix2 * fpix2;
I.at<cv::Vec3b>(x, y)[0] = (pix0 > 255) ? 255 : uchar(pix0);
I.at<cv::Vec3b>(x, y)[1] = (pix1 > 255) ? 255 : uchar(pix1);
I.at<cv::Vec3b>(x, y)[2] = (pix2 > 255) ? 255 : uchar(pix2);
}
}
}
在上面的命令中,我删除了引号。 Incrontab无法使用单引号或双引号运行。
请记住:请在终端执行时保留报价。