必须有一种方法可以将在特定日期和时间范围内修改的文件复制到另一个位置。 类似于this one但在CMD或VBS中。
我已经尝试了XCOPY /D
参数,但它的作用是从该特定日期及之后复制文件。
还尝试了Robocopy / MAXAGE / MINAGE,但它仅适用于日期
答案 0 :(得分:2)
您可以 <tr>
<% prime = w.positions.joins(:company, :hire_type).where(:hire_types => { :hire_type => "Prime" }).pluck('companies.company_name').uniq %>
<% sub = w.positions.joins(:company, :hire_type).where(:hire_types => { :hire_type => "Sub" }).pluck('companies.company_name').uniq %>
<% if ((prime.length == 0) && (sub.length == 0))%>
<td class="tg-celltitle">Prime: </td>
<td class="tg-datacell"></td>
<td class="tg-celltitle">Subcontractor: </td>
<td class="tg-datacell"></td>
<% elsif ((prime.length == 0) && (sub.length != 0)) %>
<td class="tg-celltitle">Prime: </td>
<td class="tg-datacell"></td>
<% sub.each do |s| %>
<% if s == sub.first %>
<td class="tg-celltitle" rowspan="<%= sub.length %>">Subcontractor: </td>
<% end %>
<td class="tg-datacell"><%= s %></td>
<%end%>
<% elsif ((prime.length != 0) && (sub.length == 0))%>
<% prime.each do |p| %>
<% if p == prime.first %>
<td class="tg-celltitle" rowspan="<%= prime.length %>">Prime: </td>
<% end %>
<%end%>
<td class="tg-datacell"><%= p %></td>
<td class="tg-celltitle" rowspan="<%= prime.length %>">Subcontractor: </td>
<td class="tg-datacell" rowspan="<%= prime.length %>"></td>
<% elsif ((prime.length != 0) && (sub.length != 0)) %>
<% prime.each do |p| %>
<% if p == prime.first %>
<td class="tg-celltitle" rowspan="<%= prime.length %>">Prime: </td>
<% end %>
<td class="tg-datacell"><%= p %></td>
<% sub.each do |s| %>
<% if s == sub.first %>
<td class="tg-celltitle" rowspan="<%= sub.length %>">Subcontractor: </td>
<% end %>
<td class="tg-datacell"><%= s %></td>
<%end%>
</tr>
<% end %>
<% end %>
使用robocopy
和/minage
参数来复制特定日期的文件(例如2015-07-23)。您只需要为/maxage
指定下一个日的日期:
/minage