Le Mar 19 février 2013 15:24, tsit...@linuxmail.org a écrit :
> hello fellas. i was looking for a way to compress files (.wav) older than
> 30 days.
> i created a small script to do the job. #!/bin.bash
>
>
> FILES=`find . -mtime -30 | xargs`
> tar --no-recursion -czf backup_ *feb*_2013.tgz "${FILES}" rm -rf "${FILES}"
>  the compressed files have the following format g303-
> *20130205*-060552-1360037152.419.wav
> i am stuck on how to edit the script so it will automatically create the
> month of the backup. Now the naming is manual. any suggestions please?
>

=============
MONTH=`date +%B`
echo $MONTH
=============
This gives the whole month's name. Use %b to have an abbreviated one
(here, i have "février" for first, and "févr." for second. As it is
localized, I have no clue about what you will have).

the `...` is used to execute the content instead of simply using it as a
string.
Note, that this notation is the /bin/sh 's one, it works with bash, and
*should* be relatively portable. Unlike the new one (which I do not
remember anyway).


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/3f8e5bca20db6973872c6ed6d5754cc9.squir...@www.sud-ouest.org

Reply via email to