1

I have a bunch of video files in a folder on a remote drive which is mounted in Nautilus (smb/gvfs). I open the folder, drop the shell script in there, open a terminal and run it from there. It works fine on local folders, but I keep getting "permission denied" when I run it from the remote folder on it's contents. The script simply converts from one video container to another and looks like this:

!/bin/bash

for i in *.mp4;
do
ffmpeg -i "$i" -vcodec copy -acodec copy "$i".mkv;
done

I know I have done similar things in the past without problems, but this time I get permission denied even if I run as root and have the script owned by root.

What am I missing?

  • 2
    What do you mean by "from the remote folder"? did you copy (or move) the script there? if so, the issue may be that the remote filesystem does not support Unix executable bits, or may be mounted with the noexec option. – steeldriver Nov 2 '16 at 18:58
  • I'm not sure how gvfs works, but the remote file system is ext4. I guess I will have to study gvfs or find another way to mount the remote filesystem. Using Nautilus very practical though. – Christian Nov 2 '16 at 23:35
  • I also tried to run the scrip locally with path to the remote drive. Same problem. Permission denied. – Christian Nov 2 '16 at 23:49
  • As a sidenote you can 1. Copy the streams by simply using: -codec copy 2. A better name for the output file would be: "${i%.mp4}.mkv" – andrew.46 Nov 3 '16 at 19:43
  • Thank you so much! I am not a coder by any means and hacked that script together. Now it works perfectly, but still not from my gvfs mounted drive. Could you be permissions on the ext4 file system the driver is formatted with? – Christian Nov 4 '16 at 13:28

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.