Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 50 lines (33 sloc) 1.124 kb
784582b * Change /usr/local/bin/perl to the perl in PATH.
audreyt authored
1 #!/usr/bin/env perl
39240f9 [STD_syntax_highlight] added a cron script
azawawi authored
2
3 use strict;
4 use warnings;
5 use English;
6 use feature qw(say);
7
8 # act nice
9 use POSIX qw(nice);
10 nice 19;
11
12 my $WEB_ROOT='~/public_html';
13
14 print <<"INTRO";
15
16 Hi my name is $PROGRAM_NAME.
d13b580 [std_hilite] perl6-> Perl 6 typo
azawawi authored
17 I am usually run as a cron job to generate Perl 6 syntax highlighted htmls.
39240f9 [STD_syntax_highlight] added a cron script
azawawi authored
18
19 INTRO
20
21 my $status;
22
263c207 @azawawi [std_hilite] Use git instead of svn
azawawi authored
23 say "\n--Running 'git pull' for std";
24 $status = system('cd ..; git pull');
25 die "Could not git pull for std\n" if $status != 0;
39240f9 [STD_syntax_highlight] added a cron script
azawawi authored
26
1e1b03c [STD_syntax_highlighter] cron job now properly svn up pugs directory
azawawi authored
27 say "\n--Running 'make clean all' for STD.pm";
c63a749 [std_hilite] made it work
azawawi authored
28 $status = system('cd ..; make clean all');
39240f9 [STD_syntax_highlight] added a cron script
azawawi authored
29 die "Could not make STD.pm\n" if $status != 0;
30
eea32b9 [STD_syntax_highlight] correct cron script message
azawawi authored
31 say "\n-- Running syntax highlighter";
8bcd2f7 [std_hilite] fixed cron script
azawawi authored
32 $status = system("cd ..; std_hilite/spec_highlight");
39240f9 [STD_syntax_highlight] added a cron script
azawawi authored
33 #die "Could not run spec_highlight\n" if $status != 0;
34
35 say "\n-- Copying the result to $WEB_ROOT/html";
8bcd2f7 [std_hilite] fixed cron script
azawawi authored
36 $status = system("/bin/cp -R ../html $WEB_ROOT/");
39240f9 [STD_syntax_highlight] added a cron script
azawawi authored
37 die "Could not copy the output\n" if $status != 0;
38
39 say "\n-- I am done... Thanks for your valuable time";
aa3d3cd [STD_syntax_highlight] added a commented sample cron usage
azawawi authored
40
41 =head1 sample usage in cron
42
43 PATH=/bin:/usr/bin:/usr/local/bin
44 LANG=en_US.UTF-8
45
46 # m h dom mon dow command
263c207 @azawawi [std_hilite] Use git instead of svn
azawawi authored
47 1 */5 * * * (cd ~/std/std_hilite; ./cron_spec_highlight 2>&1 | tee html/log.txt)
aa3d3cd [STD_syntax_highlight] added a commented sample cron usage
azawawi authored
48
49 =cut
Something went wrong with that request. Please try again.