Help with rysnc and find with date variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with rysnc and find with date variable
# 1  
Old 12-21-2011
Help with rysnc and find with date variable

I want to have a script to create directory labled with the date, convert a load of flac files to mp3 and then find and rysnc the newly created mp3 file to the dated directory. Here's what I have done so far but the rsync command doesn't work:
Code:
#!/bin/bash
#set date variable as now
DATE=`/bin/date +%y%m%d`

#create dir for DATE
mkdir /media/raid10/music/newmp3/$DATE

#run flac2mp3
/media/raid10/music/flac2mp3_wPics/flac2mp3_wPics/flac2mp3.pl /media/raid10/music/flac /media/raid10/music/mp3

#copy new mp3 to DATE directory
rsync `find /media/raid10/music/mp3 -type -f -iname "*.mp3" -atime $DATE` /media/raid10/music/newmp3/$DATE

Any help would be greatly appreciated!!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to replace a parameter(variable) date value inside a text files daily with current date?

Hello All, we what we call a parameter file (.txt) where my application read dynamic values when the job is triggered, one of such values are below: abc.txt ------------------ line1 line2 line3 $$EDWS_DATE_INSERT=08-27-2019 line4 $$EDWS_PREV_DATE_INSERT=08-26-2019 I am trying to... (1 Reply)
Discussion started by: pradeepp
1 Replies

2. UNIX for Beginners Questions & Answers

Script to find a date variable and increment it

Hi, I have parameter file wo_location.prm which has a date variable $last_upd_date= 02032016. I need to write a unix shell script to find that variable and increment it by 1 day. The path to the file is root/dir_lc/shared/param/wo_location.prm and the variable is $last_upd_date. Any... (2 Replies)
Discussion started by: isenhiem
2 Replies

3. UNIX for Dummies Questions & Answers

Find the count of files by last created date based on the given date range

My unix version is IBM AIX Version 6.1 I tried google my requirement and found the below answer, find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20" But newer command is not working in AIX version 6.1 unix I have given my requirement below: Input: atr files: ... (1 Reply)
Discussion started by: yuvaa27
1 Replies

4. Shell Programming and Scripting

Convert a date stored in a variable to epoch date

I am not able to pass date stored in a variable as an argument to date command. I get current date value for from_date and to_date #!/usr/bin/ksh set -x for s in server ; do ssh -T $s <<-EOF from_date="12-Jan-2015 12:02:09" to_date="24-Jan-2015 13:02:09" echo \$from_date echo... (7 Replies)
Discussion started by: raj48
7 Replies

5. Shell Programming and Scripting

Find week of the year for given date using date command inside awk

Hi all, Need an urgent help on the below scenario. script: awk -F"," 'BEGIN { #some variable assignment} { #some calculation and put values in array} END { year=#getting it from array and assume this will be 2014 month=#getting it from array and this will be 05 date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies

6. UNIX for Dummies Questions & Answers

compare two directories after rysnc

Hi, I ran rsync command to copy all files, directories and subdirectories from /home/dir1 to another Target directory /home/dir2 Now I want to make sure everything is copied over without missing anything. Is there a command I can run which will compare both directories and check to see if I am... (4 Replies)
Discussion started by: tkhan9
4 Replies

7. UNIX for Dummies Questions & Answers

rysnc

hi I have a rsync working between two servers but i would like to write this to a daily log on completion to a area on one of the servers. This way i can check if sync was successful easily. Rsync i am running is as follows rsync -aWv -e ssh --stats progress --delete --ignore-errors... (2 Replies)
Discussion started by: treds
2 Replies

8. OS X (Apple)

bizar rysnc problem

Hi all, i'm syncing two raid sets together using "rsync -avE --delete" i build the two raid sets identical to each other using storenext , however when i let the script run a couple of times my destination is about 300 GB larger then my source. i run the command as root on a 10.5.6 Xserve and... (2 Replies)
Discussion started by: wessel
2 Replies

9. UNIX for Advanced & Expert Users

date issue-find prevoius date in a patricular format

Hi , I have written a shell script that takes the current date on the server and stores it in a file. echo get /usr/home/data-`date '+%Y%d'`.xml> /usr/local/sandeep/GetFILE.ini I call this GetFILE.ini file from an sftp program to fetch a file from /usr/home/ as location. The file is in... (3 Replies)
Discussion started by: bsandeep_80
3 Replies
Login or Register to Ask a Question
DIR2OGG(1)						      General Commands Manual							DIR2OGG(1)

NAME
dir2ogg - Convert MP3, WAV, and M4A files to OGG format SYNOPSIS
dir2ogg [ options ] ( filename [filename2] ... || directory [directory2] ... || [cdrom-device] ... ) DESCRIPTION
dir2ogg converts MP3, M4A, WMA and WAV files to the open-source OGG format. dir2ogg is a python script that simply binds together mpg123, faad, and oggenc making it easier for the user to convert his/her music files. OGGs are about 15 to 20 percent smaller than MP3 files, with the same relative audio quality. dir2ogg can be called with the -d flag at the command line to convert any number of directories at once, or given MP3, M4A, WMA, and/or WAV filenames as arguments, dir2ogg will convert only those files. If converting WAV, M4A or WMA files with -d you must add the -w, -m or -W command line flags respectively. These flags are not neccesary unless using -d. Note that converting M4A files requires you to have faad installed, and converting WMA files requires mplayer. Keep in mind that converting from MP3 or M4A to OGG is a conversion between two lossy formats. This is fine if you just want to free up some disk space, but if you're a hard-core audiophile you may be disappointed. I really can't notice a difference in quality with 'naked' ears myself. General Options -h or --help print quick usage details to the screen. -d or --directory convert all MP3 files in directory. WAV and M4A files will be converted if used with the -w and -m command line flags. This option is for compatibility purposes only and does not need to be specified anymore. -r or --recursive like -d but descends recursively into directories. -c or --cdda Convert an audio CD into ogg. You may pass the device as an argument to the script (default: /dev/cdrom). Requires cdparanoia orq icedax or mplayer -p or --preserve-wav preserve all WAV files. By default they are deleted. -P or --no-pipe Do not use pipes to send data from the decoder to the encoder, use temporary wav files instead. --delete-input Delete the input file after conversion -v or --verbose increase dir2ogg's verbosity. -Q or --quiet Do not display progress messages, except the name of the file which is currently converted. Some decoders provide no way to disable messages and thus may still display some. Conversion options --convert-all Convert all supported audio files found in the directories given on the command-line to Ogg Vorbis. -f or --convert-ape Convert all APE (Monkey's Audio) files found in the directories given on the command-line to Ogg Vorbis, using either ogg123 or flac or mplayer. -f or --convert-flac Convert all FLAC (Free Lossless Audio Codec) files found in the directories given on the command-line to Ogg Vorbis, using ogg123 or flac or mplayer. -m or --convert-m4a convert all M4A (MPEG-4 Audio) files found in the directories given on the command-line to Ogg Vorbis, using faad or mplayer. For decoding ALAC (Apple Lossless) files, 'alac-decoder' may be used. -m or --convert-mpc convert all MPC (MusePack) files found in the directories given on the command-line to Ogg Vorbis, using mpcdec or mplayer. -W or --convert-wma Convert all WMA (Windows Media Audio) files found in the directories given on the command-line to Ogg Vorbis, using mplayer. -w or --convert-wav Convert all WAV files found in the directories given on the command-line to Ogg Vorbis. -V or --convert-wv Convert all WV (WavPack) files found in the directories given on the command-line to Ogg Vorbis. -n or --no-mp3 ingore all MP3 files found in directories given on the command-line. --(ape|cd|flac|m4a|mp3|mpc|wma|wv)-decoder=COMMAND Set the decoder you want to use for one filetype, e.g.: --mp3-decoder=lame. Run dir2ogg --help to see the available decoders. -qN or --quality=N OGG quality. N is a number between -1 and 10. Default is 3. Decimals are OK (ie: 3.7) -t or --smart-mp3 Try to use the same quality as the input file. MP3 input only! SEE ALSO
mpg123(1), mplayer(1), oggenc(1) BUGS
Enter you bug reports in Launchpad at https://bugs.launchpad.net/dir2ogg AUTHORS
0.10 and newer: Julian Andres Klode <jak@jak-linux.org> 0.9.3 and older: Darren Kirby <d@badcomputer.org> CONTRIBUTORS
original wma support: Cameron Stone <camerons@cse.unsw.edu.au> smart-mp3: Marek Palatinus <marek@palatinus.cz> dir2ogg 0.11.8 2009-08-04 DIR2OGG(1)