Search Results

Search: Posts Made By: user`
4,567
Posted By agama
I would have done it this way: if awk -v...
I would have done it this way:


if awk -v date="$(date "+%Y %m %d" )" '
BEGIN {
split( date, dt, " " );
split( "1 -2 1 0 1 0 1 1 0 1 0 1", dim, " " ); ...
4,567
Posted By Chubler_XL
Oops something seems to be missing here try: ...
Oops something seems to be missing here try:

#!/bin/sh

if [ `date +%d` -eq `cal | awk '$NF{E=$NF} END{printf E}'` ]
then
rm /home/user/tst/logs/* && rm /home/user/tst/stats/*
fi
exit 0
1,349
Posted By edehont
Ftp uses ASCII-transfer mode by default. A zipped...
Ftp uses ASCII-transfer mode by default. A zipped tar is binary.
Issue the command 'binary' to tell ftp to treat your upload as such.
4,567
Posted By jim mcnamara
eom=$(cal | tr -s '\n' ' ' | awk '{print $(NF)}')...
eom=$(cal | tr -s '\n' ' ' | awk '{print $(NF)}')
if [ "$(date +%e)" = "$eom" ] ; then
# do something
fi


Generally as Chubler points out, you want this script to run every day of the...
4,567
Posted By agama
The percent sign in a command must be escaped...
The percent sign in a command must be escaped (\%). Alone it is treated as a newline which is likely the cause of the error indicated.
4,567
Posted By Chubler_XL
Probably best to run job every night: 59 23 * *...
Probably best to run job every night:
59 23 * * * /home/user/eomt.sh >/dev/null 2>&1and check for end-of-month in eomt.sh:
#!/bin/sh
if [ `date +%d` -eq `awk '$NF{E=$NF} END{printf E}'` ]
then
...
6,066
Posted By agama
If your cut/paste is accurate, your problem is...
If your cut/paste is accurate, your problem is likely because you have spaces round the equal sign in the assignment of day:

day = $(`date '+%e'`)

However, I question your logic. Deleting your...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 09:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy