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
dr_symlinks(1)							  USER COMMANDS 						    dr_symlinks(1)

  NAME
      dr_unsort - unsort the current mpd playlist

  SYNOPSIS
      dr_unsort

  DESCRIPTION
      dr_unsort invokes unsort(1) on the current audio playlist as used by mpd.  Use it if you'd like some variation in your music.

  EXAMPLE
      If The_Beatles/The_White_Album_I/03-Glass_Onion.ogg is the current playing track and your current playlist looks like

	Flying_Lotus/Los_Angeles/01 Brainfeeder.mp3
	The_Beatles/The_White_Album_I/01-Back_in_the_U.S.S.R..ogg
	The_Beatles/The_White_Album_I/02-Dear_Prudence.ogg
      > The_Beatles/The_White_Album_I/03-Glass_Onion.ogg
	The_Beatles/The_White_Album_I/04-Ob-La-Di,_Ob-La-Da.ogg
	The_Beatles/The_White_Album_I/05-Wild_Honey_Pie.ogg
	The_Beatles/The_White_Album_I/06-The_Continuing_Story_of_Bungalow_Bill.ogg
	The_Beatles/The_White_Album_I/07-While_My_Guitar_Gently_Weeps.ogg
	Flying_Lotus/Los_Angeles/02 Breathe . Something_Stellar STar.mp3
	Flying_Lotus/Los_Angeles/03 Beginners Falafel.mp3
	Flying_Lotus/Los_Angeles/04 Camel.mp3
	Napalm_Death/The_Peel_Sessions/01-The_Kill-Prison_Without_Walls-Dead_Part_1.mp3
	Napalm_Death/The_Peel_Sessions/02-Deceiver-Lucid_Fairytale-In_Extremis.mp3
	Napalm_Death/The_Peel_Sessions/03-Blind_To_The_Truth-Negative_Approach-Common_Enemy.mp3
	Napalm_Death/The_Peel_Sessions/04-Obstinate_Direction-Life-You_Suffer_Pt_2.mp3
	Flying_Lotus/Los_Angeles/05 Melt!.mp3
	Flying_Lotus/Los_Angeles/06 Comet Course.mp3
	Flying_Lotus/Los_Angeles/07 Orbit 405.mp3
	Flying_Lotus/Los_Angeles/08 Golden Diva.mp3

      invoking dr_unsort will yield something like e.g.

	Flying_Lotus/Los_Angeles/01 Brainfeeder.mp3
	The_Beatles/The_White_Album_I/01-Back_in_the_U.S.S.R..ogg
	The_Beatles/The_White_Album_I/02-Dear_Prudence.ogg
      > The_Beatles/The_White_Album_I/03-Glass_Onion.ogg
	Flying_Lotus/Los_Angeles/02 Breathe . Something_Stellar STar.mp3
	The_Beatles/The_White_Album_I/04-Ob-La-Di,_Ob-La-Da.ogg
	Napalm_Death/The_Peel_Sessions/01-The_Kill-Prison_Without_Walls-Dead_Part_1.mp3
	Flying_Lotus/Los_Angeles/03 Beginners Falafel.mp3
	The_Beatles/The_White_Album_I/05-Wild_Honey_Pie.ogg
	Napalm_Death/The_Peel_Sessions/02-Deceiver-Lucid_Fairytale-In_Extremis.mp3
	Flying_Lotus/Los_Angeles/04 Camel.mp3
	The_Beatles/The_White_Album_I/06-The_Continuing_Story_of_Bungalow_Bill.ogg
	Napalm_Death/The_Peel_Sessions/03-Blind_To_The_Truth-Negative_Approach-Common_Enemy.mp3
	Flying_Lotus/Los_Angeles/05 Melt!.mp3
	The_Beatles/The_White_Album_I/07-While_My_Guitar_Gently_Weeps.ogg
	Napalm_Death/The_Peel_Sessions/04-Obstinate_Direction-Life-You_Suffer_Pt_2.mp3
	Flying_Lotus/Los_Angeles/06 Comet Course.mp3
	Flying_Lotus/Los_Angeles/07 Orbit 405.mp3
	Flying_Lotus/Los_Angeles/08 Golden Diva.mp3

  WARNING
      Due to limitations in the mpc/mpd protocol, dr_unsort needs filesystem level write access to mpd's playlist directory.

  ENVIRONMENT
      dr_unsort honors strings DR_PLAYLISTS (mpd's playlist directory) and DR_UNSORT (unsort pathname).

  SEE ALSO
      unsort(1), available from http://packages.debian.org/unsort.

  COPYRIGHT AND LICENSE
      This manpage is copyright 2010, 2011 Joost van Baal <joostvb-draai@mdcc.cx>.

      Draai is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, as published by the Free
      Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed	WITHOUT  ANY  WAR-
      RANTY. You should have received a copy of the GNU General Public License along with draai. If not, see http://www.gnu.org/licenses/.

  AUTHOR
      Joost van Baal <joostvb-draai@mdcc.cx>

  dr_symlinks 20110603						     03 juin 2011						      dr_symlinks(1)