I have this vlc script for automating VLC so that it plays a certain number of TV show episodes. Once you plug in the relevant path and create a list name for a text file where the absolute paths of all the media files get written, it plays a chosen number of files and then exits.

I've recently added a desktop to my PC lineup and now all my files are stored there. It's a Win7 box, and all the relevant directories are being shared. When the files were local, I had no problems at all. Now, I'm having a problem either with Samba, or with my file name structure which contains spaces and special characters. I'm not sure which is the cause of the problem.

On my Linux laptop, where this script is running, the shared folders are all permanently mounted in a mountpoint I created - /mnt/Shares/SubFolders

From the Linux laptop, I have full read/write access. I can execute the pertinent commands in this script manually from a terminal, and they complete successfully without any problems. When I try to run the script, though, it does create the list with the given name, but the file is empty, as though the folders were empty.

Here is the script:

Code:

#!/bin/bash## Creates a list of all files in all Simpsons folders and then# plays so many random episodes with VLC Media Player.# Created by Uncertain

I assume it's a problem with the find|sort string, since it's creating an empty file list. I'm not sure what the problem would be, since I can copy & paste that command string into a terminal and it will execute without a problem. In fact, I can create the list manually like that, and the script will run without issue. When there's an empty list, though, VLC just opens & closes right away since there's no file being played.

But it works. Look at the conditions: if -f $list echo "list found", else echo "not found" and build the list with the find string. Which part doesn't make sense?

Truthfully, none of the echoes need to even be there. It's the first script I ever wrote, I built it a section at a time, and needed those messages in the terminal to know which stage it was in as I strung it all together.

When all's said and done, that has nothing to do with why the command won't find folders inside a samba share when it's part of a script, but works fine when copied & pasted to the command line.

I'm not sure what's wrong with the find | sort bit. I would try systematically removing things from that command until you get something that works, and then build it back up from there. For example, start by removing the "sort" and output directly to file. Then, remove some of the expressions from find. Last, run the find command on a normal directory. Somewhere in there, you should be able to find out what's not working.

Thanks for the reply, thobbs. I actually more or less did that - it's what led me to find that I could execute the command manually from a command prompt and have it execute normally. Since the folders in question are on an external USB drive, I've been able to try with the drive connected directly to the computer this command (script) is running on, and it works flawlessly when the files are local.

I thought it might be the mountpoints I had set for the top-level dir that holds the folder I'm indexing, but I've changed the from places in /home/name/XXXX, to /media/XXXX, to where they currently are inside /mnt/XXXX.

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum