Script to compare partial filenames in two folders and delete duplicates
Background: I use a TV tuner card to capture OTA video files (.mpeg) and then my Plex Media Server automatically optimizes the files (transcodes for better playback) and places them in a new directory. I have another Plex Library pointing to the new location for the optimized .mp4 files. This results in two folders containing files with the same name except for the file extension. My goal is to run a script every x number of minutes/hours to delete the original .mpeg files if the Plex server has already optimized them. I'm familiar with crontab well enough to set the script to run periodically but cannot figure out how to create the script to compare/delete the files.
Example;
Original video files:
Optimized video files:
The script would compare files in the two directories (minus the file extensions) and delete all files in /mnt/Plex/DVR/Original/ that match. In the example above all files in /mnt/Plex/DVR/Original/ would be deleted to save space on the hard drive.
Any insight is appreciated.
Last edited by rbatte1; 01-12-2017 at 07:45 AM..
Reason: Added CODE tags
guys i need some help in writing a shell script, what i am trying to write is a shell script that can delete generated trace files my software usually generated everyday, i will give an example to make it easy to understand
root@cms-db # pwd
/pcard17/trace
root@cms-db # ls -l HSM_VERIF.TRC*... (4 Replies)
I do not know much about shell scripting so I am at a loss here. If someone can help me, that would be great!
I have two directories
/dir1
/dir2
I need to delete all files from /dir1 and that does not have a correspondent file in /dir2. It should NOT check file suffixes in /dir2 . Why?... (20 Replies)
Hello,
i have the following problem:
there are two folders with a lot of files.
Example:
FolderA contains AAA, BBB, CCC
FolderB contains DDD, EEE, AAA
How can i via script identify AAA as duplicate in Folder B and delete it there? So that only DDD and EEE remain, in Folder B?
Thank you... (16 Replies)
Hi Folks -
I'm quite new to awk and didn't come across such issues before. The problem statement is that, I've a file with duplicate records in 3rd and 4th fields. The sample is as below:
aaaaaa|a12|45|56
abbbbaaa|a12|45|56
bbaabb|b1|51|45
bbbbbabbb|b2|51|45
aaabbbaaaa|a11|45|56
... (3 Replies)
This has been tearing my hair out.
I need to:
1: compare server1:/data/archive/ to server2:/data/archive/ (through rsync, ssh, etc)
2: filenames that don't match, get copied (scp) to server2:/data/
server1 and server2 have ssh, scp, rsync access between eachother.
Is there any option in... (3 Replies)
Hi,
I need help in shell scripting. If someone can help me, that would be great!
Problem. I want Linux Script to compare two folders and copy missing files.
Description.
I have two directories
/dir1
/dir2
I need to copy all distinct/new/unique/missing files from /dir1 and that... (1 Reply)
Hi there,
I am having trouble with a script I have written, which is designed to search through a directory for a header and payload file, retrieve a string from both filenames, compare this string and if it matches make a backup of the two files then move them to a different directory for... (1 Reply)
Hi Everyone,
I work for GE Money IVR as a DB analyst and the environment on which I work is Solaris 5.0 server and Oracle 11g.
I got a project in which I have to clean up the folders and files which are not used in DB.
I copied an existing script and edited it, dont know this is the... (5 Replies)
Hello, my first thread here.
I've been searching and fiddling around for about a week and I cannot find a solution.:confused:
I have been converting all of my home videos to HEVC and sometimes the files end up smaller and sometimes they don't. I am currently comparing all the video files... (5 Replies)
Hello,
How can I remove partial duplicates and manipulate text in bash using either awk, grep or sed? Thanks.
Input:
ted,"foo,bar,zoo"
john-son,"foot,ben,zoo"
bob,"bar,foot"
Expected Output:
foo,ted
bar,ted
zoo,ted
foot,john-son
ben,john-son (4 Replies)
Discussion started by: tara123
4 Replies
LEARN ABOUT NETBSD
auvitek
AUVITEK(4) BSD Kernel Interfaces Manual AUVITEK(4)NAME
auvitek -- Auvitek AU0828 video capture device driver
SYNOPSIS
auvitek* at uhub?
dtv* at dtvbus?
video* at videobus?
uaudio* at auvitek?
audio* at uaudio?
DESCRIPTION
The auvitek driver provides support for USB video capture devices based on the Auvitek AU0828 bridge. This hybrid analog/digital device
requires a hi-speed USB host controller (such as ehci(4)) to function properly.
For auvitek devices with analog audio capture interfaces, the uaudio(4) device driver provides access to the audio stream. Application soft-
ware can find a video(4) device's audio(4) device by comparing the VIDIOC_QUERYCAP bus_info field with the audio device's AUDIO_GETDEV config
field.
The following cards are supported by the auvitek driver:
Device Decoder Tuner
Hauppauge WinTV-HVR-850 au8522(4)xc5k(4)
Hauppauge WinTV-HVR-950Q au8522(4)xc5k(4)
Cards with an XC5000 tuner require the firmware provided by the pkgsrc/sysutils/xc5k-firmware package to function properly.
SEE ALSO audio(4), dtv(4), dtviic(4), ehci(4), uaudio(4), video(4)
pkgsrc/sysutils/xc5k-firmware
HISTORY
The auvitek device driver appeared in NetBSD 6.0.
AUTHORS
The auvitek driver was written by Jared D. McNeill <jmcneill@NetBSD.org>.
BSD August 30, 2011 BSD