473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Crontabs for automatic site updates.

Crontabs for automatic site updates.

Does anyone know how to set up a crontab for automatically updating
a webpage on a regular basis. We know how to set these to run perl
files, but seem to have an issue as far as comming up with the command
to copy one html file to replace another. Any help or simple scripts
to do this will be greatly appreaciated.

--
The List Man
http://www.esotericwonders.com
Aug 2 '05 #1
2 3097
The List Man wrote:
Crontabs for automatic site updates.

Does anyone know how to set up a crontab for automatically updating
a webpage on a regular basis. We know how to set these to run perl
files, but seem to have an issue as far as comming up with the command
to copy one html file to replace another. Any help or simple scripts
to do this will be greatly appreaciated.


1) Determine how to update the html files from the command line.
2) Use crontab to execute that command.

00 00 * * * perl fixup.pl; rsync -av public_html user@webhost:

Note that this is not really a perl question, and that postings
should be made to comp.lang.perl.misc (not comp.lang.perl).
-Joe
Aug 2 '05 #2
On 2005-08-02 21:15:11 +0200, The List Man
<li********@esotericwonders.com> said:
Crontabs for automatic site updates.

Does anyone know how to set up a crontab for automatically updating
a webpage on a regular basis. We know how to set these to run perl
files, but seem to have an issue as far as comming up with the command
to copy one html file to replace another. Any help or simple scripts
to do this will be greatly appreaciated.


Shell commands between ``s will be executed. So you can do:
`cp $source $destination`
If you want to keep the output (so you can check if something went wrong):
$output = `cp $source $destination`

For example, if you want to copy index.html to index.7.17.2005.html,
and then copy a new file to index.html (with the dates changing
everyday):

#!/usr/bin/env perl

# get the date
($s, $m, $h, $d, $M, $y, $wd, $doy, $dst) = localtime(time);
$y += 1900;
$d--;
$yesterday = "$M.$d.$y"; // yesterday's date m.d.y

# paths
$path_to_website = "/var/www/html";
$path_to_new_file = "/home/myself/website/index.html";

# copying
`cp ${path_to_website}/index.html ${path_to_website}/index.$yesterday.html`;
`cp ${path_to_new_file} ${path_to_website}/index.html`;

Aug 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Gert van der Kooij | last post by:
Hi, It's no problem to define the automatic maintenance using the wizard but I want to use commands to automate automation. I captured the SQL statements when activating the maintenance but that...
1
by: Michel Esber | last post by:
Hello, Linux RedHat AS4 running DB2 V8 FP11. I have followed the docs at http://tinyurl.com/qckrn and enabled automatic statistics collection. It has been 2 days since I updated my DB cfg and...
1
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy...
1
by: Ibrahim. | last post by:
Hello, I have a problem, when ever windows updates happens automatically in my system the cookies are deleted from the browser environment. I have a web site that I visit regularly and have...
0
by: =?Utf-8?B?VG9kZA==?= | last post by:
I need to be able to set Windows "Automatic Updates" to "Download updates for me, but let me choose when to install them" on my clients computers programmatically. If someone could point me in the...
4
by: =?Utf-8?B?Zmx5ZXJk?= | last post by:
I have win xp home, automatic updates set for auto at 3:00 am. The download and install happens. (Proved by looking on web update history and in windows directory) however the yellow icon w/ the...
1
by: =?Utf-8?B?LUdFUC4=?= | last post by:
My wife's machine had to have Windows XP Pro repaired from the original old installation CDs, which seemed to work fine until Automatic Updates revealed it needed 89 critical updates...all of which...
2
by: raaman rai | last post by:
I have turned up Automatic Updates in my system in it daily updates and ask for restart after successful installation. Today again my system was restarted on its own after the updates but...
0
by: raaman rai | last post by:
This is quite irratiting to find out that my system is enabled with automatic updates and it periodically updates my pc with the latest updates. But recently i encountered network problem once the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.