simple script to move files after processing

Come up with a useful post-processing script? Share it here!
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: simple script to move files after processing

Post by Mar2zz »

mv -fv "$1/*" $HOME/Desktop/

try this
Crush
Newbie
Newbie
Posts: 15
Joined: May 8th, 2010, 1:46 am

Re: simple script to move files after processing

Post by Crush »

Mar2zz wrote: mv -fv "$1/*" $HOME/Desktop/

try this
THis doesn't work either :(
User avatar
Mar2zz
Jr. Member
Jr. Member
Posts: 85
Joined: February 4th, 2011, 8:30 am
Contact:

Re: simple script to move files after processing

Post by Mar2zz »

use cp instead of mv and delete sourcefiles after succesfull copy.
Crush
Newbie
Newbie
Posts: 15
Joined: May 8th, 2010, 1:46 am

Re: simple script to move files after processing

Post by Crush »

Yeah. I forgot to post in this thread. I got this working. I love it!

Code: Select all

#!/bin/bash

DIR_DEST=${HOME}/Movies/
DIR_TRASH=${HOME}/.Trash/

mv -f "$1"/* $DIR_DEST && mv -fv "$1" $DIR_TRASH
Rumik
Newbie
Newbie
Posts: 13
Joined: January 30th, 2012, 3:14 am

Re: simple script to move files after processing

Post by Rumik »

Hi all, can you help me?

I'm running sab on max OS X and am in need of a script to copy files sab downloads to a specific folder into another folder. no moving, no deleting, just copying. I had a friend write a python script but it doesn't seem to work, so having looked here a bit it seems the .sh scripts are simpler. So anyway, can anyone help me out?

Thanks :)
ronaldhovens
Newbie
Newbie
Posts: 2
Joined: November 10th, 2013, 3:38 pm

Re: simple script to move files after processing

Post by ronaldhovens »

This one works for me on MAC OSX (modified from Mar2zz » februari 10th, 2011, 7:24 pm). His script could not handle directories with spaces in them but mine does ;-)

#!/bin/bash
for folders in "$1"/* ; do
newpath=$(echo $folders | sed "s#/Users/Chris/Downloads/#/Network Drive/#g")
mkdir -p "$newpath"
mv -f "$folders"/* "$newpath"
done
rm -Rf "$1"
ronaldhovens
Newbie
Newbie
Posts: 2
Joined: November 10th, 2013, 3:38 pm

Re: simple script to move files after processing

Post by ronaldhovens »

Excuse me... My last script had an error, it created subduers instead of files.
Here's the correct script:

#!/bin/bash
for folders in "$1" ; do
newpath=$(echo $folders | sed "s#/Users/Chris/Downloads/#/Network Drive/#g")
mkdir -p "$newpath"
mv -f "$folders"/* "$newpath"
done
rm -Rf "$1"
Ilium
Newbie
Newbie
Posts: 2
Joined: December 20th, 2013, 7:56 pm

Re: simple script to move files after processing

Post by Ilium »

Sorry for piggy-back riding on this thread, but I have exactly the same noob problem.
All I want to do is move a movie folder after it has been unpacked and the folder has been renamed back from UNPACK_movie to <movie>.

I have an EventGhost automation set up that will run The Renamer and try renaming the folder and moving it to another folder,
where Ember Media Manager will scrape it. When SABNZBd unpacks the movie into the automation folder, the initial folder name
is "UNPACK_movie_title" and this will trigger my automation, even though the file is still in use.

That's why I thought it would be better to wait until the movie is extracted and then move the entire folder to M:\movies afterwards.
Has that already been discussed here? Sorry, I am really an idiot when it comes to scripts, but if you need car repair, I'm your man lol.,
bmupton
Newbie
Newbie
Posts: 9
Joined: November 9th, 2012, 7:14 pm

Re: simple script to move files after processing

Post by bmupton »

I think my last post in this thread: http://forums.sabnzbd.org/viewtopic.php?f=9&t=16457 may help you. It's a Windows batch script, but the theory behind it should get you going.
groovio
Newbie
Newbie
Posts: 2
Joined: June 10th, 2015, 2:14 pm

Re: simple script to move files after processing

Post by groovio »

Hi Guys,
my first time here :)

so, whats the final script like ?

Please could use the help.
Im on OSX.

Thank YOU O0
Post Reply