copy to duplicates locations

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

copy to duplicates locations Fri Oct 25, 2013 7:57 am • by bausi2k
Hi,

i have the following rule which quietly not works correct - can anybody help please?

if a new music files is copied into this folder, the files should be added to itunes, copied into to folders and afterwards everything should be "cleaned up"

i think the rule is set up correctly, but it doesn't delete the files at the end...

cheers.kg
Rule: http://cl.ly/image/2p2z1u1A3n3u
bausi2k
 
Posts: 4
Joined: Thu Jun 21, 2012 3:24 am

Re: copy to duplicates locations Fri Oct 25, 2013 11:17 am • by Mr_Noodle
Which file do you want to be moved to the trash? Keep in mind that after a copy action, subsequent actions operate on the copy, not the original. Also, whenever you do a copy then throw the file away, you can do a move operation instead.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: copy to duplicates locations Fri Oct 25, 2013 4:57 pm • by bausi2k
hi,

i want to copy the file in the "root" directory - where the rule is based to two folders, added two itunes and the original can be deleted afterwards.

alternatively i also could make a third folder "itunes" and a shell script:


cp $1 folder1
cp $1 folder2
cp $1 folderiTunes
rm $1

cheers.kg
bausi2k
 
Posts: 4
Joined: Thu Jun 21, 2012 3:24 am

Re: copy to duplicates locations Mon Oct 28, 2013 11:17 am • by Mr_Noodle
How about starting with a move as the first operation instead of a copy?
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: copy to duplicates locations Mon Nov 04, 2013 10:22 am • by bausi2k
i was afraid that the other copies wouldn't be executed. I fixed it now with the following script:

Code: Select all
#!/bin/bash
#Version 1.0: initial Script
#Version 2.0: rewritten for check on vaild files support

folder1="/Users/abc/Desktop/matchedMusic/Ninschi"
folder2="/Users/abc/Desktop/matchedMusic/NAS"
folder3="/Users/abc/Desktop/matchedMusic/iTunes"
input="/Users/abc/Desktop/matchedMusic"

ls -l $input | egrep 'm4a|mp3'

if [ $? == '0' ]
then
   cp $input/*.??? $folder1
   cp $input/*.??? $folder2
   cp $input/*.??? $folder3
   rm $input/*.???
fi
bausi2k
 
Posts: 4
Joined: Thu Jun 21, 2012 3:24 am


Return to Support