General :: Shell Script That Adds Users Name To A File When The File Is Modified?
Mar 30, 2010
I need a shell script that will add the users name and date to a file when the user has modified the file, these files are within a group and only accessible to this group. But we need a way for people in the group to know who and when the file was last modified.
View 1 Replies
ADVERTISEMENT
Jun 17, 2011
I have two linux servers, they are backup together.
1. Server 1 have 3 files with name: file1, file2, file3 in the path: /etc/sysconfig/network-script/.
2. Server 2 have 3 files with name and path are the same as server 1.
- How to make a script to copy 3 files at server1 to overwrite on server2. But before overwrite, this script will check and compare the last modified date of these 3 files(on server1 and server2). if the modified date of file1, file2 or file3 on server1 is newer than 3 files on server2 then overwrite process will do, if not, will do nothing.
- see my script as below: it works find now but just overwrite. not check last modified date.
View 1 Replies
View Related
Jan 11, 2010
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.
View 2 Replies
View Related
Sep 3, 2010
I got myself a .bashrc file off the net. I checked it beforehand, didn't detect anything bad about it. One thing that's odd about it, is that several spaces are added to the terminal command line.Screenshot:Those spaces are not put there by me. The file can be found here: [URL]..
View 3 Replies
View Related
Oct 28, 2010
I checked the smbclient man but could not find any switch to us in combination with 'get' to check if the file has been modified before download.
View 1 Replies
View Related
Jan 12, 2011
I have a Redhat server that it is allowed rcp file from remote server, it is strange that after I modified the .rhosts, the server is no longer to accept rcp file , even I use other user to rcp files , the error is still "Permission denied", can advise what is wrong ? what daemon that I can try to restart ?
View 5 Replies
View Related
Dec 9, 2008
How can I read .gz file direct on shell/terminal without decompressing the file?
satimis
View 5 Replies
View Related
May 23, 2011
i am trying to convert a binary file in to ASCII using shell script. this file contains multiple types of data like string, number, bcd, etc.
View 5 Replies
View Related
May 11, 2011
I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.
Should I be looking to concatenate the files into one file with the file names included, and then print them?
something like: -printfunction -printername < file*
View 7 Replies
View Related
May 3, 2011
I want to know what system call is used in linux C programming is used to know whether a file is modified. I know that make utility compiles the file using the modification dates only. I want know how to find whether the file is modified or not.
View 4 Replies
View Related
Mar 1, 2011
In /etc/default/rcS I have set FSCKFIX=yes. This solves a recurring 'no init found' problem that prevents my machine from booting. Occasionally however, the setting reverts (by itself somehow) to FSCKFIX=no. Thus my machine cannot boot. Is there a way that I can prevent this file from being changed?
View 1 Replies
View Related
Jan 27, 2011
I use RadHat Linu5.We usually log in to LINUX via putty (remote). Very often many people use the same user and password to log in.I wonder how to tell who has edited/modified a file?
View 9 Replies
View Related
Jan 27, 2011
I use RadHat Linu5.
We usually log in to LINUX via putty (remote). Very often many people use the same user and password to log in.
how to tell who has edited/modified a file?
View 9 Replies
View Related
Aug 20, 2010
How do you find a file modified March 17, 2010, between 3:30 pm and 4:05 pm? I know that I must be missing something somewhere.How do you search for info like this? I goggled "search files time Linux" and got about 38,300,000 results. I looked through the first four pages and did not see what I was looking for.Do I need to calculate how many minutes ago that is and give that to find.I really want to do this in the GUI so that I can operate on the files found without typing in so much stuff.
View 1 Replies
View Related
Jul 9, 2010
I am new to Scripting. I am trying to find out particular file is modified in last one hour or not in script and then if that file is modified in last one hour i need to copy that file to another directory.Can any one please provide me how to check the file is modified in one hour or not?
View 3 Replies
View Related
May 28, 2010
I need to write a script that is given a directory as an argument, and it prints the last modified file from that directory and all its subdirectories.
for example:
$ newest /usr/etc
--> /usr/etc/httpd/httpd May 28 12:16
If I had to do it only for the current dir, it would be easy...I'd probably use "ls -lt" and then show only the first line...
View 1 Replies
View Related
Jan 27, 2010
I'm using Bluefish on my laptop to modify files on my desktop web server. The machines are networked with samba. Every time I save the files, I'm prompted with this window that says: File has been modified by another process. It gives me the option to cancel or overwrite. It's the only program that does this. I can click on overwrite and that works, but it's pretty annoying.
View 1 Replies
View Related
May 11, 2011
I followed this tutorial to setup a mail server, followed it to the letter, double/triple/quadruple checked everything for human error, and I can't find anything.[URL].. What's happening is it seems that postfix is adding a trailing slash to usernames when it does the user lookup, so they don't exist and then fail. I've attached the log below.
Code:
May 11 01:06:27 vmail postfix/smtpd[1688]: connect from localhost[127.0.0.1]
May 11 01:06:55 vmail postfix/smtpd[1688]: 3372E982BC: client=localhost[127.0.0.1]
May 11 01:07:18 vmail postfix/cleanup[1691]: 3372E982BC: message-
[Code]...
View 1 Replies
View Related
Jul 6, 2011
Prior to making a fresh install of 10.04, I made a back up of all my documents by copying them to a NTFS partition. I did this my selecting files in File Browser, then right clicking and selecting the Copy command.
When I came to move the files back after the fresh install, I was mortified to find that all the file modification dates had changed to the date I copied them! I've lost all the original file dates, which was the principal way I sorted my files. I guess there's no way of getting it back? It seems that Linux does not store File Creation dates either so I'm stuffed.
View 3 Replies
View Related
Oct 31, 2010
Code:
cat ${SOURCE}/{start,universal,index,end}.txt > ${SERVER}/index.html
cat ${SOURCE}/{start,universal,02042010,end}.txt > ${SERVER}/02042010.html
[code]....
View 3 Replies
View Related
Jul 9, 2009
parsing xml file using shell script and generate report in a PDF file
Xml file input:
<report>
<student name="x" father name="x1" class="first" Address="xyz">
<property name="sports" value="yes"/>
<property name="drawing" value="no"/>
[code]....
View 12 Replies
View Related
Apr 16, 2011
i accidently modified my file system of some partition in my hard disk from ntfs to fat...i havnt formatted the drive...but now i cannot mount this partition...
View 1 Replies
View Related
Feb 18, 2010
is it possible to create a shell script that adds user and password in the passwd and smbpasswd?
View 3 Replies
View Related
Apr 26, 2011
as the title, I have to create a file, example: /home/john/file.ini I created an user and a group, myuser:mygroup and set them to this file.ini chown myuser:mygroup file.ini Ok, my problem is I have another user named mymain this user must read this file, so how can I change the permissions? IMPORTANT: I ONLY have to allow "mymain" user to read this file, NOT all other users
View 3 Replies
View Related
May 11, 2010
I have a folder at /home/www/, and the owner is www, which is part of the www-group. I have another user, john, part of the john group. How can I chown /home/www/ to make it writable by both www and john?
View 2 Replies
View Related
Oct 23, 2010
I have a MP3 player which is owned by Root. I have tried the following: in terminal - chown as both my usual log-in and root operation not permitted. I ran chown as both su, root, and myself. In Nautilus - I can't change any of the file attributes again opening it as any of the users above. I used to be able to copy files over to the MP3 player but not the Sandisk but not I can't copy or do anything to the files on both.
View 1 Replies
View Related
Jan 3, 2011
So if I have a file with a list of files:
file.txt
file1.a
file2.b
file3.c
and I wanted to perform a script using a loop or recursively on each of those files, is there any way that I could do this?
I saw that xargs might be able to help me.
Here is sorta what I want to do:
Code:
#!/bin/bash
cat file.txt | xargs?? # Some commands to turn each line into a variable
for var in ${@}; do # Some way to get each of the files
# script on each file
View 1 Replies
View Related
Jul 30, 2010
I'm using Ubuntu minimal install (With no window manager). What is the quickest and easiest way to upload a file somewhere? Something like a script to pastebin would work.
View 2 Replies
View Related
May 9, 2011
I have a small script that uses the find command to look for a log file named: backup_log.txt. And then uses the first value in the log file as a variable in the script later on. However, say there are two or more of these log files located in different directories, how would I let the user choose which log file will be the one to use, and then make that (fullpathtofile) the value of the variable that will be used.
View 5 Replies
View Related
May 2, 2011
I am working on some homework, however i am not here to be spoon fed. I am trying to get the numerical modification date of each file in a folder. Ie lets say there is a file called bob and it was modified 2006-11-23. i want to get it into a variable as 20061123.
Now i currently have this code:
Code:
However for some reason my output is:
Quote:
See how the 2011 has been placed next to it? i ran it with -x and saw this:
Code:
However i do not know how to find a way around this?
View 11 Replies
View Related