I have two machines, both are centos 4.4 (one is a virtual machine, the other is not) they are treating file timestamps differently. Below is an example from each of the machines to demonstrate.
Code:
[behaving as expected]
-bash-3.00$ ls -1t --full-time
Currently I am using the following command to copy and add date and time stamp to files.cp /home/work/file.grn /home/xfer/rename_`date +%Y%m%d%H%M%S'.grn.If I have five files for ex: file_1.grn, file_2.grn,file_3.grn ...can I copy those five files a different directory and with a different file name and with date time stamp to it.The output filenames name_1_yyyymmddhhmmss.grn,rename_2_yyyymmddhhmmss.grn,rename_3_yyyymmddhhmmss.grn ...
I've these 2 UNIX timestamps values taken from the java method System.currentTimeMillis(). These 2 timestamps correspond to the start time and the end time of 2 process that ran. Here are the values:
I wrote this little script and I need some help, I am trying to achieve following:Every day I receive new file in the /home/denis/MyData/ folder and I don't know what the file mane will be but I want to move any file that arrives there to the new location /media/DataBackup/Linux/backup/ (media/DataBackup/ is external 500GB USB drive)to automatically create new folder with the date and time stamp every day and then to move content of the /home/denis/MyData/ into the new folder with current date stamp. So every day there will be new folder and will contain files for that day only.My script is as follows:
cd /media/DataBackup/Linux/backup/ mkdir MyData_$(date +%Y%b%d_%HH%MM) #this creates file MyData_current date and time
For the second time in a week, I have set up an unmanaged CentOS 5.5 Storm Server at StormOnDemand, only to discover a ton of unauthorized changes to binaries (updated file checksums and sizes) on the server shortly thereafter.The time stamps do NOT change.If the time stamps did change, I would be hunting down ahat was doing some auto-updates. But the time stamps are not changing.This leads me to believe that either these servers are suffering from:1. A virus or hacker is compromising the box.2. system corruption.3. Something else? To eliminate the possibility of number 1, I toasted the first server and started over with a new server and enabled their firewall from the start to only allow access for two IPs via SSH... my IP and my biz partner's.
Then, one of the first things we installed was a system we created that maintains a snapshot of most directories on the system so that it can be used to watch the live directories for changes. At 4:07am (server time) this morning, we received notice from this system that a massive number of files had changed in these directories. Again, no file time stamps changed.So, my question is this... is there any legitimate reason in a fairly standard CentOS 5.5 install that would cause so many files to change?
To get the kernel messages of new java process, i refer the details from /proc/<java pid>/stat and /proc/<java pid>/statm files. For some java processes, I didn't find any details in the /proc/<java pid>/statm file. It has only 7 number of 0s. But /proc/<java pid>/stat file has the details. And also this kind of process will have the life time of nearly 1 minute.
Kernel version using: Linux-2.6.18-8.1.8.el5 Is there any possibility of java process without the memory details in the /proc/<java pid>/statm file? If it is possible, how to know the memory related details of that processes?
When using make menuconfig - under Device Drivers --> Character Devices --> there should be an option with the label "Enhanced Real Time Clock Support" (CONFIG_JS_RTC).
The problem is that this option seems to only show up while using the menu method when other options are either enabled or disabled and I've entirely forgotten what should be what. I swear fingered it out once.
This is on an older computer (P4) so HPET is no good.
You would think that disabling the HPET option would enable the RTC option but that does not appear to be the case.
I understand I can just add the option to the .config file and avoid this hassle but I'm very interested to know how to make this work.
To show my appreciation I will do something nice for you such as call you a nice name or tell you that you are pretty (or ugly if that's what you prefer).
I need to get the modified date on a file in linux to use in a script.I tried using 'ls -l' on the file, but this caused problems when the date turned from a single digit into a double. The reason for the problem was because I was parsing the result string on spaces.How can I get the date of the last time a file was modified so I can use it in a script? For example, if a file was modified on 1/11/2010, I need the 11.
I need to goto a folder, open a script file (same file every time). The file has different function calls, I need to comment all other function calls and just un-comment the one I want to use.
I have downloaded a movie (avi) file via utorrent. Download has been complete. On trying to play the movie via VLC and Divx, what comes up is ' Codec is missing please download and install from [URL]. on going on this site i get what looks like an analysis. on reading it i see highlighted in the category SOA the information says SOA Expire 5 weeks..How do I update this or even what file exactly should I look for when uploading a movie via torrent..
Objective: To move or backup all the 30 days old files to the other server within LAN. I have tried testing it first within the server by performing below commands: find /usr/test1/* -mtime +30 -exec mv {} /usr/test2/ ; But I'm getting "mv: missing file argument" error when I try this.
I have a log file that I would like to examine during some changes under process that writes to this log. Is there some way to open this file and read in real time changes written to it ?
I want to search in my apache log, for events which have occurred say between 11:00 AM to 2:00 PM. I have got few scripts/commands but they are not conclusive, some of then are trying to do an exact match(awk) and for some i am just getting the pattern wrong (eGrep)
Today i am trying to learn how to use sed. I set up a testing folder with the following files:
AAb.lol AAc.lol AAx.lol test.sh
My goal is to create a script (test.sh) which renames all the files to their original name without AA. I want to end up with this:
b.lol c.lol x.lol test.sh
sed seemed to be the perfect tool so i went ahead and created a script which i think should clear the job.
[Code].........
mv: missing destination file operand after `$i' From that 2nd line i can tell that $NewName is just empty. I also read something about sed needing the -e option for scripting purposes but i just don't understand it.
Im looking for an app pr line of code that could let me observe a process, save the info in a number of variable and then put the gathered info on a file.
Ive been trying with variations of top but no luck. I am running several CentOS virtual servers, VM is 2gb ram 2 processor.
Maybe a script that works over a specified amount of time while writing lines with the info on a text file so at the end i can have a sort of table with the data.
The thing is Im going to stress test the server and I would like to have the data to make some statistics.
How I can tell tar to assign a new creation date to extracted files? Let's say I have an archive filled with old files of varying ages. Upon extraction I want all files to have the same time stamp (that of the time of the extraction).
I am tying to read a file in with nawk whilst trying to take input from a pipe. I've come across the getline option and no matter how hard I try, I can't figure out the correct syntax. What I want to do is to take some input from the pipe and make a comparison with all of the values in a file and print a match.
suppose i have two file with same name fstab one file is located in /etc and the other is located in /root/ If i make a change in /etc/fstab file the changes has to reflect in /root/fstab . Is there any command to do this?
I know this command exists I just can't seem to find it. I want to see the last few lines of a file as more are added in real time. Can someone point me in the right direction?
I was wondering if there is a command to show a real-time creation of files. I basically executed a command that will created thousands of files and takes a long time. I want to check if it is still creating additional files or if ti got frozen.