1

I use my synology DS1515+ and DSM 6.2.2.

First of all, please refer to the picture as below;

enter image description here

First, I download some video files. Examples of filenames are as above.

And second step is that copying files to /volume1/Daily/

I've already solved it so far and there's no problem.

I'd like to solve the final step.

After copying files to /volume1/Daily/, I wanna move these video files to /volume1/Temp/

I think this sequence is important because

if these files move to /volume1/Temp/ before copying, copying can't be executed.

So I think that it would be checked files are already copied to /volume1/Daily/ (whether files are in the /volume1/Daily/ directory or not) before moving to /volume1/Temp/.

In conclusion,

if video files were in /volume1/Daily/, I'd like to move files to /volume1/Temp/.

Could you help or explain how to do it?

It will be run the command only on the synology. (to use task scheduler in the control panel)

If you explain to me, please include path of directory in my case as above.

(because I can't apply the code what you recommend to me for lack of my understanding. I apologize)

2 Answers 2

0

I believe this would help ;

test -e /volume1/Daily/<file-name> && mv /volume1/Daily/<file-name> /volume1/Temp/<file-name>  
3
  • @Freddy : yeah , thanks for notifying... Apr 11, 2020 at 14:30
  • I think the source dir is /volume1/download/ :)
    – Freddy
    Apr 11, 2020 at 14:35
  • @Freddy : No i think , once its downloaded in download directory , he is copying those into Daily directory , he needs to verify if its already in Daily directory then move it to temp directory ... Apr 11, 2020 at 14:43
0

I solved as below;

find "/volume1/Download/" -type f -printf "%f\n" | while read filename
do
if [ -f "/volume1/Daily/$filename" ] ; then
   mv "/volume1/Download/$filename" "/volume1/Temp/"
else
   echo "skip"
fi
done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .