Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
February 09, 2012, 04:25:45 PM

Pages: [1]   Go Down
  Print  
Author Topic: Cron copy and rename file assistance needed  (Read 3171 times)
idjn
Newbie
*
Offline Offline

Posts: 4


« on: August 10, 2009, 11:38:42 AM »

I need to copy a file, once each night, to a new directory. And rename the file once moved.

This CRON job I added doesn't seem to do it:

cp -f /public_html/mysite-com/infofeeds/data-monday.txt /public_html/mysite-com/index.txt

data-monday.txt needs be moved and renamed index.txt monday morning...
data-tuesday.txt needs be moved and renamed index.txt tuesday morning...
data-wednesday.txt needs be moved and renamed index.txt wednesday morning, etc.

None of the old "index.txt" files need to be saved.

Thanks for any tips!
Brian
« Last Edit: August 10, 2009, 10:27:16 PM by idjn » Logged
MrPhil
Berserker Poster
*****
Offline Offline

Posts: 5083



« Reply #1 on: August 11, 2009, 05:50:36 AM »

There's no such directory as /public_html. Either drop the leading "/" or add "/home/ACCOUNTNAME" in front of it. When you start up a cron job, you are usually in the /home/ACCOUNTNAME/ directory.
Logged

idjn
Newbie
*
Offline Offline

Posts: 4


« Reply #2 on: August 13, 2009, 10:53:41 AM »

Thanks.. making fix to test

Brian

There's no such directory as /public_html. Either drop the leading "/" or add "/home/ACCOUNTNAME" in front of it. When you start up a cron job, you are usually in the /home/ACCOUNTNAME/ directory.
« Last Edit: August 13, 2009, 10:56:04 AM by idjn » Logged
mp3renamer
Newbie
*
Offline Offline

Posts: 1


« Reply #3 on: April 30, 2010, 10:12:39 AM »

I have a linux box which creates video files hourly, I need to backup these files once they are created to a network share accesible via smb - the files are date stamped; YYYYMMDDHH.mpg


File Renamer
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: