Jump to content

if directory has *file*, move directory


NewDisplayName

Recommended Posts

Hi, im searching for a script (or idea)

 

im using currently

mv *img 

mv *iso

to mv it to watch folder.. any idea how i can also move the directory where the file is in to watch folder? (so that SAME_AS_SRC is working?)

 

any/dir/moviename/moviename.iso

 

->

 

 /watch/moviename/moviename.iso?

 

 

Thats my userscript atm:



#!/bin/bash
mv !*/_unpack/* /mnt/user/downloads/completed/Filme/*/*.[iI][mM][gG] /mnt/user/downloads/DVDR/
mv !*/_unpack/* /mnt/user/downloads/completed/Filme/*/*.[iI][sS][oO] /mnt/user/downloads/DVDR/

logger DVDRs verschoben.

 

find /mnt/user/downloads/DVDR/ -mtime 7 -delete

 

touch find /mnt/user/downloads/DVDR/touch
find /mnt/user/downloads/DVDR/* -type d -empty -exec rmdir {} \;
rm /mnt/user/downloads/DVDR/touch

 

logger DVDRs älter als eine Woche gelöscht.

 

Problem is that handbrake dont has the correct directory because its just /watch/filename instead of /watch/moviename/filename

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...