Issue with scp to whole folder

previously 1 folder was created in a week. but now it creating more than 1 folder. shown as belowfor
example:--------------------
1 Aug A
2 Aug B
8 Aug M.

Now i want scp to the whole content for whole folder. Let say in first week having 2 folder which need to scp to remaote in twice for each folder i,e A,B. similarly in second week we need to once in a week i,e M.but i need to automate the this manual work by schedule for each week.

You might look into 'rsync', which will keep the remote looking like the local, can use ssh.

You can make local and remote file lists with "find ... -mtime -N", sort them, compare them with 'comm -23' to get the new file names, and just scp those files. If file might change, you can use cksum to add the length and sum to the name and the same comm will see if they are new.

#!/bin/bash
 
cd wherever
 
comm -23 <(
   find * -mtime -2 -type f | xargs -r cksum | sort
  ) <(
   ssh -nC host_over_there 'cd wherever
     find * -mtime -2 -type f | xargs -r cksum' | sort
  ) | while read s l n
  do
   scp -C $n host_over_there:wherever/$n
  done