The tag has no usage guidance.

learn more… | top users | synonyms

5
votes
4answers
6k views

How to determine number of week of the month

On the Linux CLI, is there a way to get the number of the week of the month? Maybe there is another way to get this with one simple (like date) command? Let's say that day 1 to 7 is the first week, ...
1
vote
1answer
487 views

Apache RewriteCond: inject string into URI between regex match groups

EDIT This works, needed to use % in place of $ for capture groups: RewriteRule (.*) http://localhost:8081/%1/%{TIME_YEAR}1101%2 [P] Having a hard time sorting this out. Need a date string ...
1
vote
3answers
3k views

Linux Centos 6.2 “hangs” until date is synchronized

I'm having a problem that i cannot understand why or how to solve it. I have a Centos 6.2 server, that's my secondary DNS (bind 8) and DHCP (ISC's dhcp server). I need to maintain an accurate date ...
5
votes
4answers
3k views

How to tell if a file is older than 30 minutes on AIX?

I'd like to write a shell script in ksh or bash which exits with 1 if a specific file is older than 30 minutes. (Last modification time is older than half hour). It would be easy on a Linux or a ...
3
votes
2answers
3k views

Why is $ date still displaying EST when /etc/localtime is symlinked to /usr/share/zoneinfo/GMT?

I'm having a problem setting the date on my server... $ ls -la /etc | grep localtime lrwxrwxrwx 1 root root 23 Mar 6 12:07 /etc/localtime -> /usr/share/zoneinfo/GMT For some reason, although ...
0
votes
1answer
274 views

setting logrotate to use UTC time

Is it possible to force logrotate to use UTC time for one configuration? I need the dateext to be set to UTC. I was hoping it was as simple as setting a date varible. Should I just run postrotate and ...
5
votes
2answers
203 views

date +%s glitches

I have a strange issue I'm starting to troubleshoot and wondered if anyone would have any helpful tips. I have a cronjob executed every minute that executes a script and appends the output to a file ...
0
votes
1answer
389 views

Sanitizing dates using sed or awk on an ldapsearch query

I'd like to pipe the output of an ldapsearch to sanitize the dates returned - I presume sed and/or awk can help with this but would appreciate a bit of help. The fixed length date format in the LDIF ...
2
votes
1answer
11k views

How do you set a DATE variable to use in a log for crontab output?

I was playing aroudn with some variations of date like DATE = $(date) but that didnt work either crontab -e CRONLOG=/tmp/log/crontab.log DATEVAR=`date +20\%y\%m\%d_\%H\%M\%S` * * * * * echo ...
2
votes
2answers
4k views

How do I set current Unix time in milliseconds?

Possible Solution date --set="2011-12-07 01:20:15.962" && date --rfc-3339=ns Original Question I can get the date with milliseconds like so: date +"%S.%N" date --rfc-3339=ns According ...
2
votes
2answers
2k views

Convert SELinux log date format from Epoch to Normal

When SELinux logs an event to the audit log on my CentOS 6 system, it's logging it in epoch time which makes for a real hassle when trying to troubleshoot. Is there any way to make it log these events ...
0
votes
2answers
214 views

search and print specific date in a log file

I'm working with a log file and I want to print from a specific day till the end of it . that specific date is ($sd=27/Dec/2002) for example. now I want to search for this day and print from it till ...
1
vote
3answers
230 views

convert epoch time to readable time foramt

I wrote a code which convert epoch time to readable time sd=`date -d '1970-01-01 UTC '$SDATE' seconds' +"%d-%m-%Y"` the output is : 27-12-2002 but I want the output to be : 27/Nov/2002 how should ...
-1
votes
1answer
89 views

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 : ...
0
votes
2answers
205 views

how to manage dates in shell

emphasized textI have a file containing 14000 dates . I wrote a script to find the last 5 days , 26/03/2002:11:52:25 27/03/2002:11:52:25 29/03/2002:11:30:41 30/03/2002:11:30:41 26/03/2002:11:30:41 ...
6
votes
1answer
1k views

Time too quick in debian, 72 minutes pass in system date in one real world second

Having trouble with system date/time in GNU/Linux/Debian: Time goes too fast for date, time, cron. The sleep command works fine, file modification times are correct. The issue explained via commands: ...
1
vote
1answer
345 views

modification time of file in future, but timezone is set correctly

Files that I am creating at a Unix server are created with a modification time that lies 5 days in future. But when I check with the date command, it seems, that timezone and date are set correctly. : ...
0
votes
1answer
657 views

Date / time out of sync by days

I have several 2003 servers in my domain that randomly change their date/time by several days, sometimes. They are all getting their time from an AD server acting as the primary DC. I have looked in ...
0
votes
1answer
316 views

Timezonesetting not honored, system keeps sitting on timezone

whatever I try, my system (Ubuntu) stays at BRT time instead of CET. I have tried: sudo dpkg-reconfigure tzdata and set the timezone to "Europe/Berlin". date still shows BRT instead of CET or ...
1
vote
4answers
2k views

cron job to remove files with specific name

I have this in my crontab 0 3 * * * mysqldump --host=10.100.100.3 --user=username --password=mypass --routines DBName | gzip > /tmp/mysqldumps/mydb.`date +"\%Y-\%m-\%d"`.gz now I need to create ...
0
votes
5answers
424 views

Find all files recursively by a certain date

My site is compromised by an FTP brute attack and the cracker modified / created some files in my home directory. Let's say the date of the malicious creation / modification is 2011-4-5 21:38:09. ...
1
vote
4answers
956 views

cron clock problem

I have noticed on my RHEL 5.5 that cron daily starts an hour later (at 1AM instead of midnight). System and hardware clock are the same. How can i set it so it will start at midnight? date [root@a ...
3
votes
3answers
455 views

date -d: what are the accepted strings?

I am using the "date" command to perform some simple date arithmetic. The "-d" option lets me do this, but the man pages are very unclear on what is valid data. What are all the accepted options, and ...
1
vote
3answers
1k views

Deleting all folders older than a specified date, except some of them

i had to do a script job in bash to delete all directory in a path which are older than a specified date except some of them. i know the name of the directories which shouldn't be deleted... Can you ...
0
votes
2answers
315 views

System reboot on executing “date -s” command

My system reboots when i give the "date -s" command. I collected the log and it says this Jan 18 13:27:46 watchdog[2421]: file /tmp/cmm/strobeWDT was not changed in 1 seconds. Jan 18 13:27:46 ...
0
votes
1answer
642 views

Defining date attributes in openldap

There doesn't appear to be a standard date syntax. How do people handle entering dates into ldap so that they are comparable and invalid data can't be entered? I'm hoping to enforce a fairly ...
0
votes
2answers
76 views

System Date and httpd/mysqld

Hi when i change the date: date -s "01 Jan 2011 01:30:15" Do services such as mysqld and httpd need to be restarted for thier date to update? or is there a better way to handle these services date ...
6
votes
3answers
11k views

Calculate Days Since 1/1/1970

How can you calculate the number of days since 1/1/1970? This is for updating the shadowLastChange attribute on OpenLDAP. Is there a way to do this using the linux date command?
3
votes
2answers
684 views

Question on date and timezone in Linux

I did the date command and it gave the following output root@localhost:~$ date Thu Dec 30 14:19:47 UTC 2010 Then i modified the date using date -s command whichn gave the following output ...
0
votes
2answers
374 views

Named pipe with shell command date

I want to let a standard user change the system date. So I created a named pipe. The standard user write a date to the named pipe and a root process listens to it and sets the date accordingly: ...
1
vote
1answer
169 views

Log “date -s” command

I know that the date -s <STRING> command sets the time described by the string STRING. What i want is to log the above command whenever it is used to set the time into the file ...
5
votes
5answers
9k views

Cannot access client pc remotely due to time/date issue xp win2k3 environment — REMOTE solution please

When I run psexec to the user desktop (xp pro) I get "There is a time and/or date difference between the client and the server." I also get "access denied" when I run the at \clientname time ...
0
votes
1answer
1k views

Forbid users to change DateTime settings at their desktop WinXP

What is the easiest way to block changing the Time and Date settings on desktop workstations running Windows XP?
1
vote
2answers
610 views

date keeps resetting

I have a virtual machine(VirtualBox) running Ubuntu server. When i issue date -s 2011-01-01 it changes the date, but after a few seconds, the date resets itself to the real time. I do not have any ...
2
votes
2answers
2k views

Bash scripting: detect first day of month

I wrote three bash files: incremental_backup full_backup execution Now I want another bash script do the following : if (date is the start of month 1/-/----) then invoke `full_back_up` ...
4
votes
4answers
3k views

Why is my “Last log on” date wrong?

I'm sitting here across the office from Bob, who is logged into the domain right now, working away. I pull up AD Admin Center and take a look at Bob's account and it tells me his last log on date is ...
1
vote
1answer
265 views

winscp filter by date

How to transfer files with WinSCP that are older than N days? It seems there is no such option inside. But could it be done with scripting/cmd mix?
0
votes
3answers
104 views

Server Time Jumped Ahead 7 Months

CentOS 5.x My CentOS server appears to have jumped ahead 7 months. I'm not sure how or why. Are there any logs in CentOS that could provide more insight here? Unfortunately, ntpd was not running. ...
0
votes
5answers
1k views

last modified date of directory

Is there any way to get the last modified date of a directory, including sub directories? either via shell script or php? Thanks!
2
votes
3answers
217 views

Changing linux date with current time

I am running sudo date +%m/%d/%Y -s 7/14/2010 command to change date. It changes fine except I want it to pick up the current time as well, and not start the time from 00:00:00 on 7/14/2010.
0
votes
1answer
64 views

Incorrect file creation/modication time in linux

In our server we get files uploaded daily by customers via FTP. However sometime the the time stamp of these appear incorrect even though the server time is correct. I got a file with time stamp Jun ...
6
votes
1answer
1k views

Is it possible to set the date on a Linux machine to the year 2040?

I need to be able to set the date on Ubuntu (8.04.4 LTS) to the year 2040 (to test something that isn't relevant to this question). Is that possible? I can run: $ sudo date -s "15 JAN 2038 ...
1
vote
4answers
153 views

One Linux server has two timer

The time on one of our Linux box is very weird. Whenever I call date 3 times, the 4th call will give a wrong time(usually 1 hour later). I have setup cron to sync with ntp server. We have 20+ similar ...
1
vote
2answers
1k views

Unable to set the date on a CentOS VM

The time on a Xen VM running CentOS 5 is incorrect. Running the date command seems to result in the expected output, but subsequent calls to date still show the incorrect time. [xxx@xxx ~]$ sudo date ...
3
votes
14answers
49k views

Finding day of week in batch file? (Windows Server 2008)

I have a process I run from a batch file, and i only want to run it on a certain day of the week. Is it possible to get the day of week? All the example I found, somehow rely on "date /t" to return ...
2
votes
1answer
2k views

Set up a permanent system date

I need to set up a permanent system date in a Linux test server for time-sensitive software which needs this time loop (Groundhog day's style) or bending time (Hiro's ones), you name it. I tried it ...
4
votes
5answers
7k views

ntpdate not updating system time in XenServer VM

We have a Debian webserver that I am trying to use ntpdate to keep the time in sync. When I run ntpdate ntp0.cs.mu.oz.au I receive 16 Sep 10:55:36 ntpdate[21626]: step time server 128.250.36.2 ...