SUSE :: Determine The Report File Name Based On The Source Directory Name And Current Date?
Apr 17, 2010
### TO DO: Determine the report file name based on the source directory name and current date### The report name and thumbnail directory must follow this pattern: source-%j-%H### for example, for pictures in /home/you/pictures, the file name will be: pictures-%j-%H### HINT: Use sed to extract the directory name from the path and combine it with date command output
View 1 Replies
ADVERTISEMENT
Mar 12, 2010
I am using CRON to create a new, blank file, every minute, in a specific location on my web server. After web searching, and reading man pages, I get the impression that the following command is supposed to work:touch /home/mydomain/var/folder/attachments/`date +%H%M`.txtThis should give me a new file with a file name that is the current hour and minute.However, when executed, the CRON mailer reports:touch /home/mydomain/var/folder/attachments/`date +/bin/sh: -c: line 0: unexpected EOF while looking for matching /bin/sh: -c: line 1: syntax error: unexpected end of fileSo, it looks like shell is seeing the plus (+) sign as an EOFObviously, nothing get created.What would be the easiest, single line command to create an empty file, at a given location, with a time based file name
View 5 Replies
View Related
Dec 29, 2010
Originally Posted by Kenny_StrawnPlease wrap [CODE] tags aroung any code posted here. The full source that way could still be posted.I am trying to copy all the files in the directory based on the modification date (i.e created on Dec 29). Not able to find the proper command for this. This is what I have tried.
(none) login: root
#
# cd /mnt/hd/
[code]...
View 8 Replies
View Related
Jul 28, 2009
selectively archive the subdirectories of a single parent directory in which said subdirectories have creation year-date 2008 and older.
View 5 Replies
View Related
Mar 11, 2011
Is there any way to tell which file or directory this is referencing in particular?
View 8 Replies
View Related
Mar 23, 2011
I have several directories of subtitles for some videos, but all the text for the subtitles in each file is in uppercase, and I would like to convert the files' content to lowercase, all in one go. I found on a website a bash command that would do each file separately:tr '[:upper:]' '[:lower:]' <input.txt> output.txt but of course involves specifying the input name and output name for each file.I have been trying to do it in a script that would work for all files in the current directory, without having to rename them each time, if that's possible. So far I've got the following, which doesn't work:
#!/bin/bash
for file in $@; do
tr '[:upper:]' '[:lower:]'
done
However, my web searches cannot locate a way of specifying "each file in current directory" in conjunction with the "tr" command, but also without having to rename the file once converted to lowercase. Is it possible, or would the tr command have to create a new file for each converted file?
View 3 Replies
View Related
Apr 12, 2010
Kindly suggest me any web based daily activity/tracker tool for small organization.
View 2 Replies
View Related
Apr 17, 2011
I'm trying to compile a program from source. When I run make the following appears:./ config. status --recheck make: ./config.status: Command not found make: *** [config.status] Error 127.There is no file called config. status in the current directory. Why was it not created?
View 1 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
Apr 30, 2010
I am total new to linux as I worked mostly on RTOS (symbian). My problem is, I need to find the file IOSTREAM.H and I am following commands below:
1) cd /
2) find . iostream.h ( finds the file / directory from the current path)
It shows No such File or Directory
View 7 Replies
View Related
Aug 24, 2010
Code:
$ echo 2 * 3 > 5 is a valid inequality. This will create a file in the current directory named '5' with the number '2' in it, the names of all the files in the current directory, followed by the number '3' and 'is a valid inequality.'
What I do not understand is why 'is a valid inequality' gets written to this file. I thought it would write '2', all the file names in the current directory, then '3' into the file called '5'. Why does the 'is a valid inequality.' get written to the file also?
View 3 Replies
View Related
Sep 28, 2010
I have very little linux experience. And need some help with a bash script. I need to a script I can set cron to run to sort files out of a holding folder into final folders. It doesn't necessarily have to be bash, but I think it would be sufficient for this. File names are formatted as such when created: Dest-Date-Time-CID-Destination# I want the files to be moved from a all in one holding folder to a folder structure like this.
.../storage/year/month/day/Destination#/VarX(type)/hour/CID/'File'
I would need an if/else if/else statement to say if Dest = A set VarX = B If for example the file name was
infinity-20100927-17:00-1112223333-4445556666.wav
I would like the above file to end up moved from
.../holding
to
.../storage/2010/09/27/4445556666/Inbound/17/1112223333/infinity-20100927-17:00-1112223333-4445556666.wav
So the script will need to make directories based on information in the file name which is delimited by single dashes. Then move files from the holding folder to the newly created "sorted" folders.
View 15 Replies
View Related
May 1, 2011
I am following instructions from [URL]... i've gotten to the point where it says
[code]...
No such file or directory. I hate installing from source for this exact reason, something always goes wrong. and i'm left scratching my head. But I really want this boot loader.
View 7 Replies
View Related
Aug 5, 2011
i just uppgraded to Centos 6. Linux 2.6.32-71.29.1.el6.i686 on i686. now im getting some troubble whit this file: wget [URL]... i create a downloads directory and download the source file and--
mkdir $HOME/downloads
cd $HOME/downloads
But when i try to build courier-authlib whit this comand: #sudo rpmbuild -ta courier-authlib-0.63.0.tar.bz2. I get this:
[code]...
what can be the reason?
View 5 Replies
View Related
Jun 17, 2010
Trying to install Oracle 11g on SLES 10 Xen virtual server. Get error /proc/sys/vm/hugetlb_shm_group: No such file or directory. I agree, it's know there...but how do I create it?
View 2 Replies
View Related
Jul 12, 2010
I would really like to preserve a file's original modified date and pass it back to the file as the same attribute after a script has worked on it. I get a lot of JPEG files from different places on the Net which I either turn around and upload or burn to disk, and having the "original" date of either download or last mod in a graphics app would be for me, in the long run, a lot more helpful when deciding, for instance, which files to "recycle" or pass on backing up more than once.I've tried doing this on my own every now and then. Where I run into problems is that it appears "stat" and "date" use different formats for date information, and I can't seem to puzzle out how to "translate" one to the other satisfactorily for the latter command.
Just to give an example:
stat foo.jpg |grep Modify gives me
Modify: 2010-07-12 06:28:56.890625000 -0400
Passing that string as-is to date foo.jpg, I get the errordate: unknown option -- 0 and the usual semi-courteous suggestion to Try 'date --help' for more information.Somehow my TexInfo database got screwed up somewhere along the line and info dategives me the short article on date input formats, not the full documentation for the command
View 4 Replies
View Related
Jan 12, 2011
What functions are available on linux for a c++ program to determine if the current user is a member of a specific user group?
View 3 Replies
View Related
Apr 13, 2011
I've tried a couple times to install from a tar.gz file and when i try to compile the source code in the terminal I get this error "tar: bash-4.2.tar.gz: Cannot open: No such file or directory" what am I doing wrong? Now when I download the files, I leave themin the down loads folder, do i need to make a new directory? If so how do I do that and how do i call it up when I compile the sopurce?
View 1 Replies
View Related
Aug 31, 2009
Hello all,
I have opensuse 10.3
Everything has been working fine for several months, then out of the blue, something changed.
I woke up to see that the system was down.
When trying to start it, it goes to
can't determine runlevel and stalls - OR - if it gets past that point, it stops at setting up the hardware clock
What steps can one take to solve the problem?
TIA
View 4 Replies
View Related
Feb 4, 2011
I recently purchased a PC with linux ubuntu installed. Is there any way to determine if the source code for my OS is present on the PC?
View 9 Replies
View Related
Nov 9, 2009
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.For example, here is what I need to strip:
Date: 11/09/09
If I manually run the following SED command, it works great, however I cannot seem to find a way to use the actual "date" command within SED, to get the desired results.
WORKING: sed -i -e 's/Date: 11/09/09/ /' myfile
I've been messing around with various attempts to do this using the "date" command within SED, but I just can seem to get it right. I've also attempted defining variables which call separate "date" commands for day, month, year and inject them via standard variable calling, echoing variable, expanding variable with brackets, etc... Here are a few of the SED command attempts I've tried:
Quote:
sed -i -e 'sate: `date +%D`: :' myfile
sed -i -e "s/Date: `date +%d`/`date +%m`/`date +%y`/ /" myfile
sed -i -e 's/Date: `date +%d`/`date +%m`/`date +%y`/ /' myfile
sed -i -e 's/Date: $(date +%D) / /' myfile
I need to replace it with the equivalent number of spaces, as I'm going to be overlaying a PCL Logo here and need to keep the structure of the rest of the file. Cannot have the remaining portion of the line shifting left.
View 5 Replies
View Related
Jun 26, 2011
Why is the output of the following commands different?
root@vmi2115:/var# hwclock
Sun 26 Jun 2011 01:21:38 PM CEST -0.273230 seconds
root@vmi2495:/var# date
Sun Jun 26 15:21:39 CEST 2011
root@vmi2115:/var#
And can I change the current time on Linux?
View 4 Replies
View Related
Mar 17, 2010
I am using Red hat Linux operating system.I want change the date exactly 5 years ago to current date with out providing month, date and time. I want only the year should be 5 years ago .please help in this regard . example . If current date is this = Wed mar 18 22:59:23 IST 2010. past date shuld be like this= Sat Mar 18 22:59:23 IST 2005
View 6 Replies
View Related
Mar 13, 2011
Currently I'm using `ls -l | grep "Mar 13" ` for listing today log files.Output :-rw------- 1 root root 2188192 Mar 13 10:33 audit.logBut my requirement like below,note permission,date,size...audit.log Note : Where 10 logs file are same directory in different date , But I'm looking files which are logging in today date (Mar 13)
View 2 Replies
View Related
Jul 29, 2010
I am new to linux platform and my requirment is to write a makfile which can compile a tree for source file and create the output in separate directory .
View 1 Replies
View Related
Jun 24, 2011
How to get the week number in linux using gawk with different first day of the week? the date command can give me the week number with +%V but it is based on Monday (1-53) or +%U (based on Sunday, 0-53).
I tried to to do this: date -d "ddmmyy+2days" +%V, but the result is not correct. I want the first day of the week is based on Saturday.
View 1 Replies
View Related
Aug 11, 2011
I know find can do what I am looking for, but I am wondering if there is an alternative way to find files on the filesystem either created before/after a certain point, or at a certain time.
Typically I rely on updatedb & locate for most of my file searching needs. Issues with those tools, though, are that it only has directory and file names, and it only creates a database of local directories, not anything mounted via CIFS|NFS or via -o loop (eg, .iso images).
So if I need to find files created after yesterday across the entire system (local and remote filesystems), I am currently needing to use find.
What other tools, if any, would accomplish this in a similar fashion?
I have tried ls and grep, but that requires (in my attempts so far) multiple searches:
ls -lR | grep Aug | grep 10
ls -lR | grep Aug | grep 11
View 6 Replies
View Related
Dec 7, 2010
I am using the Terminal. I would like to know how do I put the current date and time on my machine and the date from a certain URL that has .php extension into a file.
View 3 Replies
View Related
Aug 4, 2011
I have hundreds of MTS and AVI files since 2000 and would like to rename them in the following manner based on the date created: DD-MMM-YYYY HH.MM.SS_X; where X begins at 1 and increments by 1 if there are dublicate date/time stamped videos.
Ex: 19-Nov-2002 08.12.30.avi, 19-Nov-2002 08:13:30_1 and 19-Nov-2002 08:13:30_2
Someone previously wrote the following script for me, and it works great for photos. It uses EXIV2 to get the image date created info. I have tried to understand the script, but am struggling. The video files I have can use the date modified since I have not modified them since I filmed them.
#!/usr/bin/env python
import os
import stat
import pyexiv2
import time
directory = '/home/david/Desktop/test'
[Code].....
View 1 Replies
View Related
Feb 19, 2011
I want to create RAID disk on machine_2. Next, I want to replace one of the RAID disk from machine_2 to with the RAID disk from macnine_1. Then I want to build the RAID disk from machine_1 with machine_2 data. This is my question:
How to determine the physical drive the system boots on in a RAID array?
Or
How to determine the RAID disk from machine_1 in machine_2?
View 2 Replies
View Related