首页 \ 问答 \ 将文件夹从一个fedora 15服务器同步到另一个(Sync folder from one fedora 15 server to another)

将文件夹从一个fedora 15服务器同步到另一个(Sync folder from one fedora 15 server to another)

在一台服务器上[s1]我为一个页面创建并将一个图像调整为一个文件夹中的300x300和子文件夹中的[缩略图] 130x130。 s1是灯服务器。 我有另一台服务器[s2]运行相同的操作系统[fedora 15],仅通过nginx提供静态文件[images,css,js]。

是否可以在从s1创建[resized等]后将图像复制到s2。

这种情况每天只发生10-20次,但需要立即[如果可能]。 我读过有关使用php和sftp的内容,但我一直无法理解它。

我想我的问题,更重要的是,是; 任何人都可以推荐一种可靠的方法。


On one server [s1] I for a page I create and resize one image into a 300x300 in one folder and [a thumbnail] 130x130 in a subfolder. s1 is a lamp server. I have another server [s2] running the same OS [fedora 15] serving static files [images, css, js] only, via nginx.

Is it possible to copy the images to s2 after they are created [resized, etc] from s1.?

This only happens maybe 10-20 times a day but needs to be immediate [if possible]. I've read about using php & sftp but I have been unable to make sense of it.

I guess my question, more to the point, is; Can anyone recommend a method that is reliable.?


原文:https://stackoverflow.com/questions/9044511
更新时间:2023-04-26 09:04

最满意答案

试图循环观察是非常不必要的,因为Stata以任何方式这样做。

如果您只想使用最近的非缺失值,则可能需要此项:

clonevar issue, generate(clone) 
bys id1 id2 (date): replace issue = clone[n-1] if missing(issue) 

除了标记之外,请注意代码中的以下错误:

foreach v in 1(1)_nforeach不会用in扩展numlist ; 它也不会为你评价_n

replace issue[n] :不允许在该位置下标; replace issue意味着同样的事情。

issue[nv] :你需要一个本地参考。

and不是关键字:你需要&如果你想要一个逻辑“和”

n大概是_n的拼写错误

另请参阅此有关替换缺失值的常见问题


The attempted loop over observations is quite unnecessary, as Stata does that any way.

If you want to use only the most recent non-missing value it is likely that you want this:

clonevar issue, generate(clone) 
bys id1 id2 (date): replace issue = clone[n-1] if missing(issue) 

Note the following bugs in your code apart from that you flag:

foreach v in 1(1)_n: foreach won't expand a numlist with in; nor will it evaluate _n for you.

replace issue[n]: subscripts are not allowed in that position; replace issue means the same thing any way.

issue[n-v]: you'd need a local reference there.

and is not a keyword: you need & if you want a logical "and"

n presumably is a typo for _n

See also this FAQ on replacing missing values

相关问答

更多
  • 你可以先合并你的数组,比如 $new_array = array_merge($dogruA, $yanlisA); 然后在使用array_unique()方法将它传递给foreach之后,它会处理数组重复值, foreach(array_unique($new_array) as $single){ echo $single; } You can first merge your array,like $new_array = array_merge($dogruA, $yanlisA); the ...
  • 试图循环观察是非常不必要的,因为Stata以任何方式这样做。 如果您只想使用最近的非缺失值,则可能需要此项: clonevar issue, generate(clone) bys id1 id2 (date): replace issue = clone[n-1] if missing(issue) 除了标记之外,请注意代码中的以下错误: foreach v in 1(1)_n : foreach不会用in扩展numlist ; 它也不会为你评价_n 。 replace issue[n] :不允许在 ...
  • 我将为数字创建一个关联数组,数字为键,值为数字。 $numbers = array(); foreach (range(1, 70) as $num) { $numbers[$num] = 0; } 并与数据库循环结合起来 foreach ($dbnumbers as $num => $value) { $numbers[$num] += $value; } 然后你可以迭代它来显示;) I would make an associative array for that with the ...
  • 您不必一次使用相同的功能执行两项操作。 有时单独执行这些操作可能会更清楚。 也就是说,先分割,然后从每个元素中剥离空白(然后对结果进行排序): @email_list = sort( map { s/\s*(\S+)\s*/\1/; $_ } split ';', $file_data ); 编辑:在同一时间剥离一个字符串的多个部分可能会导致陷入困境,例如,思南恩的要点在“伊丽莎白”部分留下尾随 ...
  • 报告的问题与foreach或regress无关,而是与您使用本地宏有关。 本地宏引用周围的左右引号不同。 否则宏引用无法嵌套,这将是一个严重的问题。 这是记录在案的,例如PDF文档中的[U] 18.3.1。 您的代码还有其他问题。 让我们先修复它,使用正确的引号并修复另一个语法错误: local Region "1 2 3 4 5 6" foreach i of local Region { reg x1 x2 x3 if Region == `i' } 这里假设您有一个名为Region的变量,并 ...
  • 在LINQ中使用.ForEach: (from s in db.WfRADocStates.Include(x=>x.WfStateStatu).Include(xx=>xx.WfState).Include(xxx=>xxx.WfState.Dept).Include(d=>d.RADoc) where s.RADocID == docID && !s.isHistory && s.StatusID == 1 && ...
  • glob()返回一个简单的数组,所以只需合并两个数组,然后只有一个数组可以循环 $directory = "images/uploads/fexperience/"; $images = array_merge( glob($directory . "*.jpg"), glob($directory . "*.png") ); foreach($images as $image) { if (isset($_SESSION['loggedin']) && $_SESSION['lo ...
  • 使用一个帮助器数组和函数来查找相同的channel_id并存储其steam_name ! 在php数组中,调用相同的索引不会创建新的数组! 所以尝试将channel_id设置为索引键。 $result = findSameChannelId($array); foreach($result as $data) { echo $data["channel_description"]."
    "; } function findSameChannelId($array) { foreach ...
  • 您可以使用MultipleIterator : $m = new MultipleIterator(); $m->attachIterator(new ArrayIterator($items), 'item'); $m->attachIterator(new ArrayIterator($linkai), 'linkas'); foreach ($m as $unit) { // $unit['item'] contains an entry from $items // $unit[' ...
  • 有几种方法可以做到这一点,包括但不限于以下几点。 全部在选择器中: $('input[type="checkbox"]:not(:first)').each(...) 使用.not()方法 : $('input[type="checkbox"]').not(':first').each(...) 使用.slice()方法 : $('input[type="checkbox"]').slice(1).each(...) 请注意,实际检查/取消选中框的行可以简化为: this.checked = !thi ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)