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:
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 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
Is there any way to monitor one process' CPU usage and RAM usage over time on Linux? I am trying to change to a cheaper VPS and need to work out what level of CPU and RAM I need!
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?
I have a VPS running Debian. The time that it reports from the date command is two minutes fast.Is there a service that I can install that will keep the time correct?
I used the following command to get the unix time of root user creation:
Code: awk -F":" '$1 == "root" {print $3}' /etc/shadow How can i convert this into the date/time of creation?
I am writing a shell script, which determines the OS installation date among other stuff, and i am assuming the root user's account creation date should be a pretty accurate pointer. Are there reasons why i should not be assuming so?I would be open to other suggestion for getting this date/time, but it would nevertheless be interesting to convert the unix time to "real" time without doing complex manual(or otherwise) computation..
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
I read the man pages of batch and it says that commands or scripts scheduled using the batch command will only execute when the load average goes below 0.8. As a newbie I hardy understand what it means. Does it mean that the system resources are busy?Ans since I want to see the o/p of the commands I have set using batch, is there any way i can bring the sys load average below 0.8?
How to get the load average for each CPU core in multi core(eg:duel core machine) processor environment. I tried using,
Code: 1. cat /proc/loadavg 2. uptime 3. top But all of those commands gives the load average for whole system but not particular CPU core. Are there a way to take the load average for CPU core(Or any mechanism that can be done programmatic manner).
How to reduce the load average? I have two linux machines.. now my problem is that both the machines having same configuration and same processes are running in those two machines... But in one machine the load average is more than 3 and in other it is 0.5(when i am using top command).For this load average one machine(where load average is more) is slow when i am running application on it..
I wrote a script to extract and get the the name of *.gz in a foler . Since running that script every 10 minutes, load average on my server increases more than 10.I checked with 'top' and it showed many D process.
I have High load on my server and my investigation shows nothing (so i believe that my investigations is wrong ), the load average in this moment is 10.13, 9.47, 8.24. , mentioning the below.
- The disk utilization (all the disks) is near 0, as the result of the IOSTAT - There is no blocked processes (as a result of VMSTAT). - I have two processors (dual core) , the maximum load average should be something around 4. - The server always have above 8 load average in all times interval.
btw , my OS is RHEL AS release 4 (Nahant Update 7)Kernel :Linux 2.6.9-78.ELhugemem #1 SMP i686 i686 i386 GNU/Linux
anyway i need to take the average of all rows with the same 1st number(key). i.e.
1, 3, 4.66, 5.66, 5 2, 3.5, 4.5, 5, 3.5
I know this is something awk/sed would be great for, i just dont have enough experience with them to accomplish it, Also, what about averaging those columns together? so, after I output this to a file, id like to get another like:
1, 4.58 1, 4.125
The number of colums to add might not always be 4 either. EDIT: this might be easier to do in gnuplot, so I mainly just need an answer to the first part.
We have a server that is running RHEL4 that occasionally spikes in load average above 10 and we have no idea what is causing it. We would like to know if there are any free tools or a script that when the load average hits a certain point it will trigger the system to start logging the processes to see what is happening. Usually by the time we get logged into the system the load average is on its way down. If someone has a better idea please let me know.
I am a new learner. I need a simple scripts that compute the average ping time for hosts, and the average number of hosts that respond to pings during a traceroute. I have finished the ping part but I confused how to start the traceroute part
Code: #!/bin/bash #!/bin/sh txt=$* count=0; for host in $txt; do echo $host
I am new to shell script and to this form as well, I did try to search for a similar post like mine here, but could not find one.
Here is what I'm trying to do:
I am trying to grep server logs to find a specific string and then capture the time stamp and the value of that grep string in them. The log file prints out messages on per sec basis.
My script is able to grep the server logs for the entire period of my load runs and then outputted it to a .csv file too.
Unfortunately this .csv file is too large to extract it on my PC and to generate graphs as it exceeds the excel limit. I need some help on how to read this .csv file in a shell script and then take an average on per min basis before I can export it out on my desktop and generate graphs for analysis. example of the out in my .csv file:
For reasons I won't get into, I need to copy directories so long as the average system load is low. Can someone help me write a BASH script that will copy the contents of a directory, but check to make sure the average system load is below X before copying each file, and if not, wait Y seconds and try again?
i have been using samba to gain access into windows computer through my pc which has fedora 8 ..can i access the unix machine from another unix machine? is yes then what is the procedures ?
I tried to run % mvdir earlier and it said command not found. I then ran a search for it and still not found.Is there a place I can download the script for the command, and is there any information I should know post-download to get it to work?
I wonder if the unix commands (cp, mv, grep, args etc) are the same for Mac and Ubuntu. Do they have the same parameter lists and so on or do they try to stay the same but are slightly different?
What Linux or Unix version underlies Mac OS, OS X 10.6? Is there a good documentation for that version, specifically regarding security, networks and similar topics?
I want to code some simple personal projects on the Unix-like partition while doing everything else on my XP partition. Can someone recommend the solution that takes up the smallest footprint in size and processing power that still delivers value? I want to learn how to code in a Unix environment.
I'm trying Cygwin but my first impression is its a bit clumsy. Would a dual boot with BeOS be better? And how would I do it? EDIT: I need to be able to run both OS'es at the same time. This is very important for me. my laptop is pretty crappy and that's why I ask for something that has a low CPU/RAM footprint.
I have an NCR UNIX hard disk I need to mount it on a Linux box The FS Type in fdisk on linux is '63' for the partition How can i mount on my linux box ? what is kernel module i needed ?