pass variable to find via ssh for -newermt option
<p>I am trying to copy a group of files within a certain time range from a remote server(server B) with a script run on a local server(Server A).
I'm using the -newermt option in find to specify my time range.
So if I ssh to the remote server(server B) this works:</p>

<pre><code>find /appl/backup/monsters/green/y.y.y.y/2016-04-26_08-00-01/jelly/ -newermt "2016-04-26 07:40:00" \! -newermt "2016-04-26 07:50:00"
</code></pre>

<p>And I get the list of files for the times specified.</p>

<p>However, If I try to involke this from the local server (server A) via ssh:</p>

<pre><code>#!/bin/bash
#           
CLUSTER="green"
node="x.x.x.x"
STIME="2016-04-26_08-00-01" 
#T1=1461678000
#T2=1461678600
T1="2016-04-26 07:40:00"
T2="2016-04-26 07:50:00"             
ssh user@y.y.y.y find /appl/backup/monsters/${CLUSTER}/${node}/${STIME}/jelly/ -newermt "$T1" \\! -newermt "$T2"
echo $latest_file
echo SCP Completed.
exit
</code></pre>

<p>This gives me a find error:</p>

<p>find: paths must precede expression: 07:40:00</p>

<p>So it appears that with this method find does not like the space in "2016-04-26 07:40:00"</p>

<p>I tried converting to unixtimestamps to avoid using a space but find does not like those:</p>

<p>find: I cannot figure out how to interpret `1461678000' as a date or time</p>

<p>My question is do I have to delimit the space character for this or curly brackets, I'm trying a few things but totally fumbling around :-/ any help is appreciated.</p>

<p>Thanks!</p>