Crontab不会写入指定的日志文件。我的命令中是否有语法错误?
0 3 * * * (cmd1; cmd2) >> /some/log/file 2>&1
我使用implicit casts作为参考
stdout
建议。当我手动执行这两个命令时,它们工作得很好,我可以看到 <?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 7,
'paged' => $paged );
$wp_query = new WP_Query($args);
$count = 0;
while ( have_posts() ) : the_post(); ?>
<?php echo get_the_title(); ?>
<?php
$count++;
if ($count === 1) { ?>
<div class="column small-12 margin-bottom-small">
<div class="panel-brown">
<img src="" alt="" />
<h5 class="heading-white"><a href="#"><?php echo get_the_title(); ?></a></h5>
<div class="para-white">
<?php $content = get_the_content(); echo mb_strimwidth($content, 0, 200, '...');?>
</div>
</div>
</div>
<?php }
while ($count <= 2) {
$count++ ?>
<div class="column small-12 medium-6 margin-bottom-small">
<div class="panel-tan">
<h5 class="heading-white"><a href="#"><?php echo get_the_title(); ?></a></h5>
<div>
<?php $content = get_the_content(); echo mb_strimwidth($content, 0, 200, '...');?>
</div>
</div>
</div>
<?php }
while ($count <= 4) {
$count++ ?>
<div class="column small-12 medium-6 margin-bottom-small">
<div class="panel-tan">
<h5 class="heading-white"><a href="#"><?php echo get_the_title(); ?></a></h5>
<div>
<?php $content = get_the_content(); echo mb_strimwidth($content, 0, 200, '...');?>
</div>
</div>
</div>
<?php }
?>
<?php endwhile; ?>
<!-- Pagination links -->
<?php next_posts_link( '← Older posts', $wp_query ->max_num_pages); ?>
<?php previous_posts_link( 'Newer posts →' ); ?>
上的输出。