|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Appending data to a file in a cron job
Hi,
I have tried these methods but the data from the "original" file does not appened to the "duplicate" file. 1) 30 10 * * * cp /htdocs/original /htdocs/duplicate As expected, this command overwrites the "duplicate" file. 2) 30 10 * * * cp /htdocs/original >> /htdocs/duplicate No changes in the "duplicate" file. 3) 30 10 * * * /htdocs/original >> /htdocs/duplicate No changes in the "duplicate" file. 4) 30 10 * * * cp /htdocs/original > htdocs/duplicate This command deletes all data in the "duplicate" file. 5) 30 10 * * * /htdocs/original > htdocs/duplicate This command deletes all data in the "duplicate" file. Can someone please help me out with this. Thanks a lot. |
|
#2
|
|||
|
|||
|
ya need to do this:
Code:
/path/to/cat what_you_want_added.file >> original.file cat is short for concatenate, check out the manpage: Code:
man cat -Steven __________________ Don’t be mistaken about this appointment Edward. I’ve always despised you. -King Richard Well you are my father of course. I mean, you’re biased. -Edmund Black Adder |
|
#3
|
|||
|
|||
|
hey steven,
its working perfectly....thanks a lot...i have been working on it for 2 days now...ur the man |
|
#4
|
|||
|
|||
|
great, glad to have been able to help.
-Steven __________________ CHISWICK! FRESH HORSES!! –King Richard, Black Adder |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Appending data to a file in a cron job |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|