General :: Script To Execute A Command Based On The Last Modified Time Of A Folder
Oct 19, 2010
I need a script that executes a command based on a folder's last modified time.
if "/var/data" was modified in less than an hour then "/usr/local/etc/searchd stop" should be run
can we use "find -mmin +60 -type d" in conjunction with second command
View 1 Replies
ADVERTISEMENT
Jun 4, 2010
is there any way to execute a command every time a "folder changes status"? Under windows there's an API which pro-actively tells you when something has changed within a directory, so I was trying to achieve something similar under Linux. I can't think anything else other than check the list of files and parameters (e.g. date/size/owner) every few seconds, but that's not ideal of course... So what I'm asking here is: is there is a way to set linux to tell me rather than me go and check?
View 2 Replies
View Related
Jul 23, 2010
I need to know the last 10 modified files in a folder.
View 8 Replies
View Related
Apr 29, 2011
I use two monitors,my problem is that I want to change the setup,so that the other monitor becomes default.There's no problem with my BIOS settings and I have tried every GUI tool that could help me(to my knowledge).Well I've found this URL...that helps a lot but I want to execute the command every time I boot before the splash screen(so that the login screen appears on the right monitor).I've tried rc.local but had no success.Any ideas on how to execute the command at boot time?
View 9 Replies
View Related
May 20, 2011
I was created one folder in linux with current time was 1978(For example). I was moved this folder to usb(FAT32 file format).While seeing this folder in window its not showing the folder time created time stamp, because the USB file system only support the year after 1980 . But again i am putting the same folder in linux ,its showing the correct time stamp.How is it possible? Because FAT32 only supports timestamp after 1980, but still its showing 1978 in linux system
View 7 Replies
View Related
May 31, 2010
I am using the following script to creates list of accessed files.I like to add modified date and time of accessed files in the output.
For this what needs to be added in the below script??
#!/bin/bash
#
# creates list of accessed files
#
set $(date)
find /hdc160GB/programmers/projects -cmin -1440 > /hdc160GB/programmers/data/fileschanged/alert_$6-$2-$3.txt
View 7 Replies
View Related
Nov 8, 2010
Sequentially number files based on date modified (rename cli)
I'm almost done a larger script which takes all the pictures in a folder, converts it to video, and emails it to me. Everything worked fine until I realized the picture filenames weren't always starting at 1, then ffmpeg chokes.
I have a bunch of files in a folder which I need to rename to:
I don't want to install any additional packages and I'd like this to run in a single command if possible.
If not possible, then a bash script would work too.
View 3 Replies
View Related
May 4, 2011
I've been given one of these ubiquitous usb-sleep buttons which is basically a supersimple usb-keyboard. It's a big button that sends a SLEEP keypress to the computer when you slam it. But that is pretty boring. I'd love to remap it to do something more fun but I can't figure out how to bind to only the sleep press from the button and not from my ordinary keyboard.
The button identifies as
Bus 001 Device 035: ID 1130:600d Tenx Technology, Inc.
I'd like to know if there's either
a way of mapping a key from a specific keyboard to an action OR a way of remapping the sleep key from a specific keyboard to a new key-code or something like that.
View 1 Replies
View Related
Dec 1, 2008
Is there a way to execute some command and then after the command completes utomatically reboot the system and then after the system reboots execute another command ? For example look at the sequence shown below(1) Execute command-1(2) After the command-1 in (1) is completed,reboot the system (3) Execute command-2(4) After execution of command-2 reboot the sytemIs there a way i can automate this process so that i need not reboot the system manually
View 5 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
Jun 19, 2011
Under a Linux shell, how can I change the creation time of all a folder's files to the current time?
View 2 Replies
View Related
Apr 6, 2011
Create a file. change its permissions at a specific time. change the permission.
At the moment this is what I have and it changes the permissions of the file but not according to the time specified.
View 2 Replies
View Related
Aug 19, 2009
I have a script which builds a project and then runs junit tests. However, if the build fails, the junit tests fail with the same error message.Therefore the command which runs the junit tests should only be executed if the build was successful.
View 3 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
May 1, 2010
i want to deny certain users based on time to login to my machine i am using CentOs 5.0 any sugestions?
View 2 Replies
View Related
Jan 25, 2011
Quote:
#!/bin/ksh
DBcounttry_finalnofunc()
{
[code]....
View 6 Replies
View Related
Apr 3, 2010
I'm trying to get my music folder into something sensible. Right now, I have all my music stored in /home/foo so I have all of the albums soft linked to ~/music. I want the structure to be ~/music/<artist>/<album> I've got all of the symlinks into ~/music right now so I just need to get the symlinks into the proper structure. I'm trying to do this by delving into the symlinked album, getting the artist name with id3info. I can do this, but I can't seem to get it to work correctly.
for i in $( find -L $i -name "*.mp3" -printf "%h
")
do
echo "$i" #testing purposes
[code]....
I'm trying to mv The Trance Mix 3 Wanderlust - DJ Exortius [TRANCE DEEP VOCAL TECH]@ into the real directory DJ Exortius. DJ Exortius already exists, so it's just a matter of moving it into the correct directory that's based on the id3 tag of the mp3 inside.
PS: I've tried easytag, but when I restructure the album, it moves it from /home/foo which is not what I want.
View 2 Replies
View Related
Aug 22, 2011
I have my music sorted using directories so I don't want a library, tags and what not.What I want:
easily (recursively) add directories to playlist from my music root, not from library songs in playlist grouped by directories they reside in directories in playlist must be collapsible and rearrangable, option to collapse all but currently played folder being a nice bonus buttons/shortcuts for next/prev directory are a must shuffle songs within their directories, shuffle directories within playlist
[Code]...
View 3 Replies
View Related
Jan 14, 2010
I am trying to find a way to execute a python script in regular time intervals? How can I do it?
View 2 Replies
View Related
Jul 28, 2010
I know several tools that allow tracking time spend on different tasks / projects.Is there any existing tool for very very simplified work-time-tracking.I am an employee, come to the office, switch on my laptop directly. I have mostly around 1 hr lunchtime, but sometimes less, sometimes more.At around 18:00 I want to type one command in the console (or simple GUI would also be okay of course) that tells me:"1 hour overworked. Go home now! (came at 8:00, 1 hour standard lunch-break)."
View 1 Replies
View Related
Jun 11, 2010
I have a folderA that contains folderB that contains a lot of files. I would like to get rid of folderB, but not its contents. I want those contents to be inside of folderA. How can I accomplish this on the commandline?
View 2 Replies
View Related
Aug 27, 2010
I want a quick and simple way to execute a command whenever a file changes. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with that file. Currently, I'm using this: while read; do ./myfile.py ; done And then I need to go to that terminal and press Enter, whenever I save that file on my editor. What I want is something like this: while sleep_until_file_has_changed myfile.py ; do ./myfile.py ; done
Or any other solution as easy as that. BTW: I'm using Vim, and I know I can add an autocommand to run something on BufWrite, but this is not the kind of solution I want now. Update: I want something simple, discardable if possible. What's more, I want something to run in a terminal because I want to see the program output (I want to see error messages).
View 7 Replies
View Related
Oct 3, 2010
How do I set up SSH so I don't have to type my password? i execute the following command ssh -l admin hostname command but each time i execute it, it ask me to enter password.how i can give it password as default because i'm going to put in bash file ?
View 2 Replies
View Related
May 4, 2011
I am working in a CentOS environment with numerous CentOS machines. Currently there are multiple developers that each have their own login/home directory and then for various admin tasks we all share a single super user account.
The problem
I have a number of aliases, variables, functions, and settings that exist in my personal login's .bash_profile. None of these are available in the shared super user's .bash_profile. My current work around is that everytime I sudo in as the super user and I re-execute my .bash_profile from my personal user's home directory. I am not allowed to edit the init stuff for the super user
The Question
Is there any way I can automate my sudo sequence such that it will execute my personal .bash_profile after I've executed sudo without requiring me to edit the super user's bash init stuff?
View 3 Replies
View Related
Jun 30, 2011
When i click in one icon (for example), this icon executes "java -jar ...". In another words: Make a .exe on linux.
View 2 Replies
View Related
Jul 29, 2010
Top: error while loading shared libraries: libproc.so.2.0.6: cannot open shared object. I am not able to execute top and ps command.
View 6 Replies
View Related
Jan 6, 2010
Is there a way to execute top command once and exit...i.e. stop refreshing window and continue console without pressing 'q' or 'ctrl+c'...
View 3 Replies
View Related
Mar 25, 2010
My problem is:
sub init() {
$Test->description("Establishing the connection to the client");
eval {
$Host = host($CLIENT) or die($@);
$Conn = connect("#ssh") or die "Client connection Failed" . $@;
};
if ($@) {
$Log->error("Unable to instantiate the Objects for the Test" .
[Code]...
Here I'm trying to connect windows machine using connect object which is working fine. But when I tried to execute the command on Windows machine from Linux machine by using:
[Code]...
View 1 Replies
View Related
Jun 15, 2011
I am having trouble getting the while loop to execute in the ssh command:ssh $USERID@serverX "while read line do echo $line done<$list_dir/cost_feed.lst.old"Error:bash: -c: line 1: syntax error: unexpected end of fileI have managed to use simpler commands with ssh like:ssh $USERID@serverX "pwd; cp x y"I expect that I need to add some combination of escape characters or semicolons
View 3 Replies
View Related
May 20, 2010
My laptop has a dead battery. Even when it's fully charged, if the power cable is pulled out it only lasts for about 4 minutes before it dies. I'm running Ubuntu Lucid Lynx 32-Bit. What I want to do is create some sort of script or program that will immediately set my computer to go into hibernation once it detects that the power cable has gone dead. I'm willing to look into all ways of doing this. I can program in C, but I'm not familiar with the API used to manage Power Management in Linux.
[Code]...
View 5 Replies
View Related