473,587 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3112
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********@eso tericwonders.co m> 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_websit e = "/var/www/html";
$path_to_new_fi le = "/home/myself/website/index.html";

# copying
`cp ${path_to_websi te}/index.html ${path_to_websi te}/index.$yesterda y.html`;
`cp ${path_to_new_f ile} ${path_to_websi te}/index.html`;

Aug 18 '05 #3

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

Similar topics

6
5469
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 didn't help. I couldn't find anything about it in the docs so if anybody could help with this it would be great. Kind regards, Gert
1
4032
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 I don´t see any activity regarding auto runstats. Also, the field STATS_TIME from syscat.tables shows that all my table statistics were last...
1
2710
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 for updating these tables via an ftp site: 1) Post a .mdb file to our ftp web site that contains the updated tables. My App code connects to the...
1
1102
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 saved my username/passoword (remember) at login. The expiry date of the cookies is set to 1 year. But when window updates happens it disappears?
0
1185
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 right direction I would appreciate it. -- Thanks, Todd Manchester Chronicle Technologies Inc
4
1688
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 exclamation point shows up in the tray to manually install the same updates. Also most of the last several updates show up several times as...
1
1221
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 downloaded, none of which installed after multiple frustrating tries. On Discussion Group exchange someone advised running CHKDSK, which I did...
2
1512
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 surprisingly i was greeted with the logon screen. Infact i have no password assigned for my system and i have only one system account created when i installed...
0
1130
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 updates get installed. Then i had to restore my system and it worked but again the updates were left to run as usual. And again i got the same problem...
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7974
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8221
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6629
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.