Sponsored Content
Full Discussion: Ssh newbie
Top Forums UNIX for Beginners Questions & Answers Ssh newbie Post 303046273 by TapasTom on Wednesday 29th of April 2020 08:17:41 AM
Old 04-29-2020
Ssh newbie

What I am trying todo is: I want to create a script on mac that monitors a folder and merge the videa and the audio. But if file01 exists (previous merge file) I want it to create file02 and if this one exists I want it to create file03,... I would be very happy if the older files could be deleted because of disk space. But this one is tricky because I monitor the folder through folder action setup on mac. This is what I get so far:
Code:
!/bin/bash
now=$(date +"%d_%m_%Y_%Hu%M") 

cd "/Users/tomvanwinkel/Documents/Convert/Merge"
for filename in .mp4; 
do     
    stub="${filename%.}" 
    /usr/local/bin/ffmpeg -i "${stub}.mp4" -i "${stub}.wav" -c:v copy -c:a aac -map 0:v:0 -map 1:a:0 "${stub}_ok".mp4
   FILE="${stub}_ok".mp4 
   if [ -f "$FILE" ]; 
   then     
      cp "${stub}_ok".mp4 "${stub}_ok01".mp4 
   fi
done


Last edited by vbe; 04-29-2020 at 09:29 AM.. Reason: code tags
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX newbie NEWBIE question!

Hello everyone, Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware. I hope I am not missing anything! :p (4 Replies)
Discussion started by: Hanamachi
4 Replies

2. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

3. Shell Programming and Scripting

perl newbie . &&..programming newbie

Hi, I am new to programming and also to perl..But i know 'perl' can come to my rescue, But I am stuck at many places and need help..any small help is much appreciated... below is the description of what i intend to acheive with my script. I have a files named in this format... (13 Replies)
Discussion started by: xytiz
13 Replies

4. Shell Programming and Scripting

could not send commands SSH session with Net::SSH::Expect

I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands. With the putty I can connect to the device and execute the commands without any issues. Here is the sample script my $ssh =... (0 Replies)
Discussion started by: hansini
0 Replies

5. Shell Programming and Scripting

Using ssh to add register key on ssh server

Hi, I want to use ssh to add a register key on remote ssh server. Since there are space characters in my register key string, it always failed. If there is no space characters in the string, it worked fine. The following is what I have tried. It seems that "ssh" command doesn't care about double... (9 Replies)
Discussion started by: leaftree
9 Replies

6. Shell Programming and Scripting

Ssh = ssh expect and keep everything not change include parameter postion

I have write a script which contains ssh -p 12345 dcplatform@10.125.42.50 ssh 127.0.0.1 -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

7. Shell Programming and Scripting

Check if file exists via ssh in ssh (nested)

I'm using redhat and have an odd issue with a nested ssh call. ssh -i ~/.ssh/transfer-key -q transfer@fserver1 ] && ssh -i ~/.ssh/transfer-key transfer@fserver1 "ssh -i ~/.ssh/sftp-key sftpin@10.0.0.1 ]" && ssh -i ~/.ssh/transfer-key transfer@fserver1 "scp -i ~/.ssh/sftp-key /home/S/outbox/*... (2 Replies)
Discussion started by: say170
2 Replies

8. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

9. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies
iowatcher(1)						      General Commands Manual						      iowatcher(1)

NAME
iowatcher - Create visualizations from blktrace results SYNOPSIS
iowatcher OPTIONS... DESCRIPTION
iowatcher graphs the results of a blktrace run. It can graph the result of an existing blktrace, start a new blktrace, or start a new blk- trace and a benchmark run. It can then create an image or movie of the IO from a given trace. iowatcher can produce either SVG files or movies in mp4 format (with ffmpeg) or ogg format (with png2theora). OPTIONS
--help Print a brief usage summary. -d, --device <device> Controls which device you are tracing. You can only trace one device at a time for now. It is sent directly to blktrace, and only needed when you are making a new trace. -D, --blktrace-destination <destination> Destination for blktrace. -p, --prog <program> Program to run while blktrace is run. -K, --keep-movie-svgs Keep the SVG files generated for movie mode. -t, --trace <file|directory> Controls the name of the blktrace file. iowatcher uses a dump from blkparse, so -t tries to guess the name of the corresponding per CPU blktrace data files if the dump file doesn't already exist. If you want more than one trace in a given graph, you can specify -t more than once. If a directory is specified, iowatcher will use the name of the directory as the base name of the dump file and all trace files found inside the directory will be processed. -l, --label <label> Sets a label in the graph for a trace file. The labels are added in the same order the trace files are added. -m, --movie [spindle|rect] Create a movie. The file format depends on the extension used in the -o filename.* option. If you specify an .ogv or .ogg exten- sion, the result will be Ogg Theora video, if png2theora is available. If you use an .mp4 extension, the result will be an mp4 video if ffmpeg is available. You can use any other extension, but the end result will be an mp4. You can use --movie=spindle or --movie=rect, which changes the style of the IO mapping. -T, --title <title> Set a title to be placed at the top of the graph. -o, --output <file> Output filename (default: trace.svg). -r, --rolling <seconds> Control the duration for the rolling average. iowatcher tries to smooth out bumpy graphs by averaging the current second with sec- onds from the past. Larger numbers here give you flatter graphs. -h, --height <height> Set the height of each graph -w, --width <width> Set the width of each graph -c, --columns <columns> Numbers of columns in graph output -x, --xzoom <min:max> Limit processed time range to min:max -y, --yzoom <min:max> Limit processed sectors to min:max -a, --io-plot-action <action> Plot given action (one of Q,D,C) in IO graph -P, --per-process-io Distinguish between processes in IO graph -O, --only-graph <graph> Add a single graph to the output (see GRAPHS). By default all the graphs are included, but with -O you get only the graphs you ask for. -O may be used more than once. -N, --no-graph <type> Remove a single graph from the output (see GRAPHS). This may also be used more than once. GRAPHS
Choices for -O and -N are: io, tput, latency, queue_depth, iops, cpu-sys, cpu-io, cpu-irq, cpu-user, cpu-soft EXAMPLES
Generate graph from the existing trace.dump: iowatcher -t trace.dump -o trace.svg Skip the IO graph: iowatcher -t trace.dump -o trace.svg -N io Only graph tput and latency: iowatcher -t trace.dump -o trace.svg -O tput -O latency Generate a graph from two runs, and label them: iowatcher -t ext4.dump -t xfs.dump -l Ext4 -l XFS -o trace.svg Run a fio benchmark and store the trace in trace.dump, add a title to the top, use /dev/sda for blktrace: iowatcher -d /dev/sda -t trace.dump -T 'Fio Benchmark' -p 'fio some_job_file' Make a movie from an existing trace: iowatcher -t trace --movie -o trace.mp4 iowatcher(1)
All times are GMT -4. The time now is 07:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy