Questions tagged [date]

149 questions
0
votes
2 answers

How to name a folder with today's date and time?

So i have this lil .bat setup @ECHO OFF echo %date% Copy D:\000Back\list.txt D:\111Back\ CD D:\111Back\ copy list.txt %date%_%time%.txt ECHO done PAUSE The second copy command never goes through, that might be because are there dots(.) in the date…
Csupi
  • 1
0
votes
1 answer

Redhat Enterprise Linux 7: How to disable DST - Daylight Saving Time

We have 16 Linux RHEL 7.5 servers in a cluster and servers are sync with crony service to NTP server We have two questions How to know if DST is configured on our servers? How to disable the DST on our Redhat Enterprise Linux 7 servers?
King David
  • 433
  • 4
  • 17
-1
votes
1 answer

Ubuntu shell: Get tomorrow's weekday

I have a shell script for backups and I need the Weekday of tomorrow. $Today = $(date +%a) #$Tomorrow = ?
Martin
  • 220
  • 3
  • 9
-1
votes
1 answer

find a date in a log file

I want to find a date in a log file and print from that date till the end of log file and that date is 5 days prior to the end of log file which is 27/Dec/2002 the log file is like this : 213.64.56.208 - - [01/Jan/2003:05:42:53 +0100] the whole…
matarsak
  • 37
  • 5
-2
votes
3 answers

Incorrect Ubuntu server time

I use 14.04.1-Ubuntu. When execute date in command line, I get time which about 1 min different comparing Greenwich Mean Time or other source. I synchronized it using sudo ntpdate -s time.nist.gov few months ago but it jumped away again. Why does it…
Justas
  • 211
  • 1
  • 5
  • 12
-2
votes
2 answers

date +"%s" returning empty string

I have a script with following lines: TIMESTAMP_END=$(date +"%s") FILE=${DIR}/recording_$TIMESTAMP_BEGIN-$TIMESTAMP_END.$EXT mv ${TMP_FILE} ${FILE} Script is running on Raspberry Pi and the TIMESTAMP_END variable is than used as a part of filename…
-2
votes
1 answer

Add date using echo without calculating

I should add the line to /var/spool/cron/crontabs/root on my ESXi: /bin/echo "0 3 * * 6 /ghettoVCB-master/ghettoVCB.sh -g /ghettoVCB-master/text.conf -f /ghettoVCB-master/text.list > /var/log/ghettoVCB-month-$(date +%m)-week-$((($(date…
A_buddy
  • 35
  • 2
  • 11
-2
votes
3 answers

crontab job is setting date wrongly

I need to set date and time in my server in order to make them synced always. I cannot use ntp inside my channel due to proxy issues. I've found this workaround. It works fine when I run it in command line interface. However when I add that command…
huzeyfe
  • 105
  • 3
-2
votes
1 answer

Set Debian Wheezy date to UTC

I'm not an expert in Linux servers, and I'd like to configure my server to use the UTC timezone, so there's no issue between the applications running on it. I don't really know how to do this. I ntp ntpdate (not sure whether it changes…
Julien
  • 99
  • 2
-2
votes
1 answer

Rounding by 5 minute interval

How do I round it to the next 5th interval? # date Sat Oct 13 22:09:25 IST 2012 # date '+%H-%M' 22-09 the output should be 22-10 When the minute is 58 it should round to 00 and not 60 though.
shantanuo
  • 3,459
  • 8
  • 47
  • 64
-2
votes
1 answer

How do I change the year in Unix?

I've looked at the man page for "date" and I can't figure out how to change the year. I know there is some string you need to create to describe the date format but how do I use that?
travis1097
  • 113
  • 1
  • 3
-4
votes
2 answers

execute bash script on last thursday of every month

Actually i have a bash script file and i want to execute it on the last thursday of every month please help me to find out the proper solution of that problem using bash scripting.
pawan
  • 1
  • 1
  • 2
-4
votes
1 answer

linux + change/edit file without effecting on file date

I want to edit some file in my linux for example ls -ltr /etc/some_file -rw-r--r-- 1 root root 188 Jul 1 2010 sysstat . echo "Server101_IP=187.0.98.4" >> /etc/some_file . I expect to get the following date: ls -ltr…
yael
  • 2,363
  • 4
  • 28
  • 41
-5
votes
1 answer

"date" returning a month as a 3-char word

At the moment I call date this way: date '+%Y %m %d' # ==> 2017 12 01 How should I adjust it so that it return a month in the 3-char format? Like this: date '+%Y %m %d' # ==> 2017 dec 01
Joddy
  • 69
  • 5
1 2 3
9
10