Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Distribution: Red Hat Enterprise Linux, Debian & Ubuntu
Using `date '+%Y%m%d'` in crontab?
I'm trying to figure out how to use cron to generate a file containing today's date, such as 'ls.log.20060105'.
I know Cron uses /bin/sh .
If I switch to /bin/sh , the command "ls foo bar > ls.log.`date +%Y%m%d` 2>&1" creates the file correctly. However, the file is NOT created when I put this same command in my crontab.
I've tried the following methods, and none of them create the file 'ls.log.20060105':
0 10 * * * ls foo bar > ls.log.`date +%Y%m%d` 2>&1
# Use a variable
0 10 * * * DATE=`date +%Y%m%d` ; ls foo bar > ls.log.$DATE 2>&1
# Use single quotes
0 10 * * * DATE=`date '+%Y%m%d'` ; ls foo bar > ls.log.$DATE 2>&1
# Escape the % characters with a \
0 10 * * * DATE=`date +\%Y\%m\%d` ; ls foo bar > ls.log.$DATE 2>&1
# Use single quotes AND escape the % characters with a \
0 10 * * * DATE=`date '+\%Y\%m\%d'` ; ls foo bar > ls.log.$DATE 2>&1
You should probably open a new thread for your question.
Giving us just the DB-.... doesn't help. We'd need to see what the script is doing at least in the section where you have that and probably the entire script. There are tools in Linux to convert upper case to lower case but nothing does it automatically without you telling it to do so. Without seeing the whole script we can't tell what is doing this in your script.