Trouble with simple script to copy/move files after download

Come up with a useful post-processing script? Share it here!
Post Reply
Mithrilhall
Newbie
Newbie
Posts: 2
Joined: February 26th, 2012, 10:38 am

Trouble with simple script to copy/move files after download

Post by Mithrilhall »

I'm attempting to write a simple script to copy/move files from my complete directory to my book_collection and I'm not sure what I'm doing. ???


Code: Select all

#!/bin/bash


# ebooks location?
book_collection="/media/f2957688-cb5e-4d5f-af3f-45d43d902197/ebooks" 

# download location?
working_dir="/media/f2957688-cb5e-4d5f-af3f-45d43d902197/nzb/Downloads/complete"

# Mode 'move' or 'copy'
mode="copy"



# Copy or Move epub books to new location...

if [ "$mode" = 'move' ]; then
  mv files with "*.epub" in name to $book_collection
  clean up old files "delete file and directory"
else
  cp files with "*.epub" in name to $book_collection
fi
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Trouble with simple script to copy/move files after down

Post by sander »

And what platform is this? Unix/linux/OSX?

Why the English pseudo code "mv files with "*.epub" in name to $book_collection" etc?

Did you base the script on an existing script?
Mithrilhall
Newbie
Newbie
Posts: 2
Joined: February 26th, 2012, 10:38 am

Re: Trouble with simple script to copy/move files after down

Post by Mithrilhall »

OS: Linux
I was looking at other scripts and got nowhere.
User avatar
sander
Release Testers
Release Testers
Posts: 8832
Joined: January 22nd, 2008, 2:22 pm

Re: Trouble with simple script to copy/move files after down

Post by sander »

Pseudo-code won't help much in the real world.

Advice: create category for Books, with a special destination directory. Problem solved. No script needed
Post Reply