ffmpeg script to convert all movies in a folder for PSP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ffmpeg script to convert all movies in a folder for PSP
# 15  
Old 09-01-2011
You can't save a password for later that way. sudo, as well as su, ssh, sftp, scp, and most other sane authentication systems, only accept passwords from a terminal, not from a script, as a security feature. There's other options, though.

You could run the entire script under a different user. Not as root -- that's almost never a good idea -- just a different user that sudo won't require a password to /sbin/poweroff with. So you type a password to get into the script and it can do what it needs to from there.

Code:
#!/bin/bash

if [ "$USER" != "scriptuser" ]
then
        # Re-load the script under the appropriate user
        exec sudo -u "scruptuser" "$0" "$@"
fi

...

Or you could run a little loop in sudo that waits for /proc/<shell's pid> to stop existing before running a /sbin/poweroff or /sbin/reboot respectively.
# 16  
Old 09-01-2011
Quote:
Originally Posted by Corona688

Or you could run a little loop in sudo that waits for /proc/<shell's pid> to stop existing before running a /sbin/poweroff or /sbin/reboot respectively.
if i understand this correct , you mean let the sudo command check if the converting is done like every 5 minutes so it remembers the password when you entter it at the beginning of the script? or do i misunderstand you?
# 17  
Old 09-01-2011
Quote:
Originally Posted by Ditzyken
if i understand this correct , you mean let the sudo command check if the converting is done like every 5 minutes so it remembers the password when you entter it at the beginning of the script? or do i misunderstand you?
Yes, you understand me. Not that it runs sudo every 5 minutes -- you run sudo once, and the command it runs checks every few minutes...
# 18  
Old 09-01-2011
and even after hours of converting (lots of movies) it still "remembered" the password

that sounds like the solution i am looking for.
gonna try to let it work, ill get back with the feedback (and propably asking for help Smilie )
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request for Shell script to move files from Subfolder to Parent folder and delete sub folder

Hi Team, I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder. Eg: parent folder --> /Interface/data/test/IN Sub folder -->/Interface/data/test/IN/Invoice20180607233338 Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies

2. Shell Programming and Scripting

Script to move one folder to multiple folder...

Hi All, I have to requirement to write a shell script to move file from one folder (A) to another five folder (B,C,D,E,F) and destination folder should be blank. In not blank just skip. This script will run as a scheduler every 2 minutes. It will check number of files in folder A and move 1 to... (9 Replies)
Discussion started by: peekuabc
9 Replies

3. Red Hat

Problem installing PSP on rhel 5.2 64

hi, i have a problem when i try to install Proliant support pack into a server with rhel 5.2 sv556:#/tmp/psp# ./hpsum -silent ./hpsum: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory i have already installed library... (3 Replies)
Discussion started by: pabloli150
3 Replies

4. Shell Programming and Scripting

Convert all files in current folder from UTF8 to ANSI, name unchanged.

Asking for a Linux command line to convert all files in current folder from UTF8 to ANSI, name unchanged. Best Regards Pei (3 Replies)
Discussion started by: jiapei100
3 Replies

5. Shell Programming and Scripting

Automated FFmpeg Convert Bash Script

I need a bash script that will. So here is what I made so far. 1. Convert video files to iPhone format 2. MV converted video to new directory (with domain.com attached to it) 4. Copy a NFO file (from another directory) and add some conversion information 5. Delete old directory torrent... (6 Replies)
Discussion started by: domz
6 Replies

6. Linux

convert avi to cellphone friendly 320x176 mp4 file...ffmpeg to the rescue :)

found a few ffmpeg posts and after a few unsuccessful attempts, I have found a solution :) to encode an avi to to an nokia e71 recognized mp4 format: ffmpeg -y -i inputFILE.avi -acodec aac -ab 72k -s 320x176 -aspect 16:9 -vcodec h264 -b 300k -qcomp 0.6 -qmin 16 -qmax 51 -qdiff 4 -flags +loop... (2 Replies)
Discussion started by: mr_manny
2 Replies

7. Shell Programming and Scripting

script for Finding files in a folder and copying to another folder

Hi all, I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt. I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
Discussion started by: satish2712
5 Replies

8. Shell Programming and Scripting

here-doc convert 2 script convert to single script?

I have my main script calling another script to retrive a "ls -alt" of a directory that's located in a remote location I'm sftping into. main.sh #!/bin/ksh getLS.sh > output.txt getLS.sh #!/bin/sh /home<..>/sftp <host@ip> <<! cd /some/dir/Log ls -alt quit ! Basically I'd like to be... (2 Replies)
Discussion started by: yongho
2 Replies
Login or Register to Ask a Question