General :: Create A Script That Will Look For A "filename" Under /etc/, Date Stamp The File And Copy It To /var/www/upload?

Jul 14, 2011

I'm trying to create a script that will look for a "filename" under /etc/, date stamp the file and copy it to /var/www/upload

View 5 Replies


ADVERTISEMENT

General :: Copy To A New Directory And Rename With Date Stamp

Oct 25, 2010

Newbie 1st post here. Trying to find the most efficient way to copy a file to a different directory and rename it with a date stamp extension. Looking to accomplish this with one command if possible.

File = make_file
Full path /home/user1/bin/scripts/make_file

would like to move to the following directory /home/user1/bin/scripts/archive/

I'm trying to find out how to use command substitution along with the date command that when I copy the file to the archive directory it gets renamed with a time stamp extension. It should look something like "make_page_12:00:00-24-10-2010" I've tried a few different combinations using the cp and mv commands but can't seem to get it to work the way I want to.

View 3 Replies View Related

General :: Use Date With Touch To Create New File With Date Based Name?

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

General :: Vsftp Cannot Upload File / Error 553 Cannot Create The File

Jul 26, 2010

I am testing my ftp server configuration.Anonymous download works , however anonymous upload does not.I am getting the following error message from both Windows and Linux 5.4clients : 553 cannot create the file.And i am running Fedore 12.

View 3 Replies View Related

Software :: Upload Documents On Site (mostly Pdfs) With Watermark-stamp?

Jun 15, 2011

I have the following issue: I want to upload some documents on my site(mostly pdfs) with watermark and as far my status is: I have managed to get my watermark in:

transparent png
pdf format

>> When it is a text/pdf I use a script using pdftk, which merges the pdf version of watermark to the pdf document (success)

>> When it is a scanned document(pdf) if I use pdftk, it only works if I apply the watermark as stamp (foreground not background). But in this case the watermark overlaps the original document despite the fact that watermark has the right opacity.... (fail) So the only solution is to apply a transparent watermark. So the question is:How to make a pdf transparent Or how to apply watermark from png file I tried adobe acrobat with wine and it applies the pdf watermark as stamp(foreground) with right opacity so I suppose it was a kind of bug maybe from pdftk, but I would like a command like way to do it so that I can make a script.

View 3 Replies View Related

Server :: Rotating Files That End With A Date Stamp?

Oct 10, 2010

how I should go about rotating files that end with a date stamp. This is the configuration I have to rotate my Apache access files, but it is not working:

/var/log/httpd/access_log.* {
compress
daily
rotate 1
copytruncate
missingok
notifempty
}


The files are created with a date extension like the ones below:

[Code]....

View 6 Replies View Related

SUSE :: Renaming Multiple Files - Adding Date / Time Stamp In Name

Feb 1, 2009

I am trying to rename multiple files in a directory and add the Date/Time stamp to the file name.

Example:
file1.txt
file2.txt
file3.txt

Renamed to
2009_02_01_21.txt
2009_02_02_21.txt
2009_02_03_21.txt

I am able to accomplish this using this command:
mv file1.txt "`date +%Y_%m%d_%H`".txt

But I want to automate this task, I have many files to process and I dont want to do them one by one.

I already tried this but it does not work
mv *.txt "`date +%Y_%m%d_%H`".txt

View 2 Replies View Related

Ubuntu Multimedia :: Rename All JPEGs In A Folder By EXIF Date & Time Stamp?

Feb 24, 2011

In the Windows world where I came from, Irfanview freeware easily renamed a large folder of JPEG photos by EXIF time & date stamps, appending a unique number if the time and date stamps were the same. Is there an equivalent rename-by-EXIF information batch command in Ubuntu 10.04 Lucid? For example, change (based solely on EXIF information): FROM:DSC_0001.JPG TO:20110224_09:34:56am.JPG

View 9 Replies View Related

General :: How To Know Total Upload And Download Stats Till Date

May 10, 2011

Am I able to know how much data I received and sent till date since my MINT 9? I wanted to know is there method that counts total stats of upload and download since I installed My linux...System monitor is good for only one session..Once you restart the PC all gone.....

View 1 Replies View Related

Ubuntu Multimedia :: Digikam - Renaming On Import - "Create Date" Versus "File Modification Date"

Jan 24, 2011

I just switched from a basic digital camera to a more advanced one that stores both Jpeg and Raw (.Nef - it's a Nikon) files for me.When importing files in Digikam, I rename the files so that they start with Date and Time. Example: 20110121-223748.JPG for a photo taken on Jan 21st 2011 at 22:37:48.I was a bit surprised when importing both the JPEG and the Raw version of the same photo, that the filename is different by a few seconds (no constant offset, sometimes they are the same):

20110121-223748.JPG
20110121-223750.NEF

I did some "research" by looking at the exif data of both files (using "exiftool 20110121-223748.JPG" from the command line). Here is what I got back

(amongst other data):20110121-223748.JPG
File Modification Date/Time : 2011:01:21 22:37:48+01:00
Modify Date : 2011:01:21 22:37:48
Date/Time Original : 2011:01:21 22:37:48

[code]....

So it seems that Digikam is using the "File Modification Date/Time" (different in the Jpeg's and Raw's of my camera) rather than the "Create Date" (the same for both Jpeg and Raw). (The few seconds difference in "File Modification Date/Time" between the two versions of the same photo is probably due to the time that my camera needs to write away the data on the SD memory card. I guess.) Is there a way to have Digikam use the Create Date? (Or the Date/Time Original?)

PS: I'm on Ubuntu 10.04LTS, using DigiKam 1.2.0

View 1 Replies View Related

General :: Create A .tgz With The Filename?

Apr 21, 2011

I have some school work that involves creating a script that creates a backup of my /home folder, everything goes well but the problem is with the filename.

I am supposed to create a .tgz with the filename : hostname-day-date-HH:MM:ss.tgz

The .tgz gets created with the correct filename but when I try to unpack it the filename can't be resolved, it's the : that mess things up.

View 2 Replies View Related

Ubuntu :: 10.04 - 'Date Modified' Changed On File Copy To NTFS Partition?

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

Programming :: Bash Script To Copy Modification Date From A File To His Folder?

Jul 29, 2011

I need this script but I don't know how to do it I have one folder with several folders inside.On each folder a have one MKV or AVI file inside...What I need is a script to change the "modification date" of each folder to the "modification date" of each MKV or AVI that the folder has inside.

View 16 Replies View Related

General :: Change File Time Stamp (Bash Script)?

Jan 6, 2010

I need some help recovering from a "slight" screwup. We just moved 3 TB of data from one RAID Array to another. Low lever archive files. This was done with a regular cp (for some reason) and now we have lost all the timestamps on the files, and we urgently need to get the timestamps back on these files.

We are running Ubuntu 9.10 Server and we have mounted the following

1. /mnt/old-raid ##Old raid from the old server
2. /mnt/new-raid ##New raid on the server

I know we can read out the timestamp on the old server using the command stat -c '%Y' <<filname>>

I know we can change the timestamp of the file, using the command touch -d '<<date>>'

To get from the stat -c date to the input date in touch we need to use date -d @<<timestamp>> +'%d %b %Y %R'

So my question is, how can I create a loop that will list all files in a folder, get their timestamp and update the old timestamp with the new?

View 4 Replies View Related

General :: Create A Script That Will Simply Create A DIR With Date And Autorun Itself Every 24 Hours?

Jan 17, 2010

i am running into few problems with the script here. I have an FTP server, all configured, and i need to have a script that will create a folder with current dated within a tree as soon as particular user logs in. I was wondering if that is possible with proftpd. if not, can someone suggest how to create a script that will simply create a DIR with date and autorun itself every 24 hours? i am running Debian/Proftpd with Mysql authorization.

View 14 Replies View Related

Ubuntu :: Pdftk Stamp Function - Stamp A Pdf Document

Apr 8, 2010

I've been trying to use the stamp function in pdftk. I'm trying to stamp a pdf document with a pdf I generate on the fly that contains the current date. Below is what I have so far. The problem is that pdftk says "Error: failed to open stamp PDF file". the file is in the same dir as execution, I've made it 776, I've specified full paths... nothing seems to work. I've even tried the "prompt" option and specify it manually but I get the same behavior. This is pdftk version 1.4.

Script (named "go"):
Code:
# date in YYYY-MM-DD format
umask 0
# create a variable with a formatted date
TODAY=`date +%Y-%m-%0e`;
[Code].....

View 3 Replies View Related

Ubuntu :: Date Change Within A Filename?

Jul 8, 2011

I'm trying to change the date of the following text file from 1970 to 2011 (I have 500 text files to rename). Can Ubuntu do this natively or will I have to speak to the "Script Guru's"?

TG.ALISISPOASDLDSIASI-1970-2d938787212.txt

View 6 Replies View Related

Debian :: Create Folder From Filename And Move File Into Folder

Feb 13, 2011

this is posable but am trying to do this "Create folder from a filename and move the file into the folder" i have 500000+ file's i need to do with is there a easy way?I really don't want to download them all make/move them with filemonkey just to re-upload them

View 2 Replies View Related

General :: Copy Files Revised After A Certain Date?

Feb 15, 2011

I am running ubundu 10.10 and want to copy all files revised after a certain date (01.02.2011) to a certain location (usb memory stick) for backup purposes. How do I use the "cp" command, or do I have to use any other command ? Or may be this is not possible in Linux ?

View 1 Replies View Related

General :: Copy All Files And Folders From Specific Date?

May 26, 2011

I wanna copy all folders and files created from 01.01.2011 until today to new placeie:cp -r /home/moviecar/public_html/wp-content/uploads/ /home/teaser/public_html/wp-content/uploads

View 4 Replies View Related

General :: Set A Pattern That Will Output A Filename Equal To The Original Filename In SoundConverter?

Jan 23, 2011

$ uname -a
Linux a 2.6.35.10-74.fc14.i686.PAE #1 SMP Thu Dec 23 16:10:47 UTC 2010 i686 i686 i386 GNU/Linux
$ lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch

[Code].....

How can I set a pattern that will output a filename equal to the original filename? E.g.

something.mp3 → something.ogg

And why isn't this implemented in SoundConverter?

PS: {Filename} doesn't work.

View 1 Replies View Related

Ubuntu :: Nautilus Script - Copy Just The Filename

Feb 7, 2011

I have found a Nautilus script that is able to copy the path of a file(e.g. /home/#&*@^/name_of_file.jpg) & I do use it regularly but I would also like to have a Nautilus script that would copy just the filename, not the path. Is there any Nautilus script out there that could do that?

View 1 Replies View Related

Programming :: Scheduled Copy Based On Filename?

Jun 17, 2010

Since I'm not building a specific piece of software but a shell script, I hope this is in the right forum. At work, we use RHEL for the basic system but have Windows clients attached as well. On the Win side, there's a program that I'm trying to duplicate on the Linux side. Because of established procedures, I can't change the way files are named so please don't suggest I do that (my boss would not be happy). We have files stored on an NFS share we manipulate on either side.

The program is used to copy files from one directory to another, based on the filenames. The first two characters of the filename are ignored (they're for human-readable sorting purposes only), the next four characters are the time, and then all characters after that are ignored. The time is read and the file gets copied at that time. (This was all done in VC++ many years ago, and nobody knows where the source code is.) For example, a file named 2d0730abcd.txt would be copied from the source directory to the destination directory at 7:30am.

It seems to me that it should be fairly straightforward to build a shell script on the Linux side to do the same thing, but darned if I can figure out which magical combination of commands to use. Would the shell script end up creating a giant pile of AT commands?

View 10 Replies View Related

General :: Script To Create Directory With Date?

Dec 6, 2010

i need to create script to make directory with the current date example : the directory name is " 060122010,1100" or near to that format

View 3 Replies View Related

General :: Script To Create New Directory With Date

Apr 21, 2011

I'm trying to write a script which will take mysqldump from a server and put it in a directory with today's date. Here's the script i've written so far:

Code:
#!/bin/sh
BACKUP=/data/backup/sql2/new_backup/daily
cd $BACKUP
mkdir `date '+%m%d%y'`

[Code]....

I want to put the mysql dump in the today's directory. How can i declare this?

View 3 Replies View Related

General :: Shell - What's The Difference Between Filename And ./filename

Apr 23, 2010

What is the difference between filename and ./filename? Under what circumstances is one preferred to the other?

View 5 Replies View Related

General :: Bash - Create Folders According To Date In System?

May 26, 2011

Is there any other short/easier and smarter way to do the following in Linux? code...

I need to use crontab to create folders every day and every month inside /home/abcd/dammi, /home/abcd/harrami, /home/wxyz/dammi and /home/wxyz/harrami. Can anyone help me with this?

View 2 Replies View Related

Programming :: Keep Original Mod Date Of A File And 'date' It Back To Same File?

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

General :: Processing Log File Within Certain Dates Based On Filename

Apr 8, 2010

I am working on the script parsing specific message "TEST" from multiple file. The log file name looks like:

N3.2009-11-26-03-05-02.console.log.tar.gz
N4.2009-11-29-00-25-03.console.log.tar.gz
N6.2009-12-01-10-05-02.console.log.tar.gz

I am using the following command:
zgrep -a --text "TEST" * | awk -F"[ .,]" '{sub(".*:","",$6); sub(",.*","",$7); print $1,$6,$7,$10}
and getting
N3 2009-11-25 20:12:57 TEST
N4 2009-11-28 10:42:18 TEST
N6 2009-12-01 10:00:24 TEST

If I only want to search the log file after 2009-11-29, what shall I change the command?

View 1 Replies View Related

General :: Filename Beginning With Left Bracket: File Cannot Be Erased

Nov 28, 2010

Kernel 2.6.21.5, Slackware 12.0

I saved a page from Linuxquestions. It was saved under a filename beginning with '[' (left square bracket). And I now can't delete the file. Unfortunately I cannot send you a screenshot because opening a terminal in the GUI makes ls behave differently. I shall try to describe, assuming the file is in dir '.'. Also let '[SOLVED]foo.html' be the file in question:

Code:
$ ls
<the file is listed>
$ ls [*
/bin/ls: cannot access [*: No such file or directory
$

If I want the hdd to get rid of this file, what should I do? Any hint will be welcome.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved