WordPress自动备份修改

发布于 2024-12-02 13:21:23 字数 850 浏览 0 评论 0原文

我目前正在尝试更改自动 WordPress 备份脚本,以便它可以保存文件更定期(大约每 6 小时一次)。

目前我无法让它工作,所以任何帮助将不胜感激。 在自动 WordPress 备份中,我添加了“经常”=>; 600 在 init 函数(第 51 行)中,并在以下代码中添加“经常”(第 369-373 行):

<select name="s3b-schedule">
<?php foreach ( array('Disabled','Often','Hourly','Daily','Weekly','Monthly') as $s ) : ?>
    <option value="<?php echo strtolower($s) ?>" <?php if ( strtolower($s) == get_option('s3b-schedule') || ((get_option('s3b-schedule') === false || get_option('s3b-schedule') == '') && $s == 'Daily') ) echo 'selected="selected"' ?>><?php echo $s ?></option>
<?php endforeach; ?>
</select>

由于整个代码相当长,我不确定是否需要将所有内容上传到此处,或者您是否需要将检查上面提供的链接中的原始包,但如果您需要更多信息,请告诉我。

谢谢

I'm currently trying to change the Automatic WordPress Backup script so that it can save files on a more regular basis (about once every 6 hours).

At the moment I can't get it to work so any help would be much appreciated.
In automatic-wordpress-backup I've added 'often' => 600 in the init function (line 51) as well as adding 'Often' in the following code (line 369-373) :

<select name="s3b-schedule">
<?php foreach ( array('Disabled','Often','Hourly','Daily','Weekly','Monthly') as $s ) : ?>
    <option value="<?php echo strtolower($s) ?>" <?php if ( strtolower($s) == get_option('s3b-schedule') || ((get_option('s3b-schedule') === false || get_option('s3b-schedule') == '') && $s == 'Daily') ) echo 'selected="selected"' ?>><?php echo $s ?></option>
<?php endforeach; ?>
</select>

With the entire code being quite long I'm not sure if I need to upload everything to here or if you'll check the original package in the link provided above but if you need more information please let me know.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜味超标? 2024-12-09 13:21:23

我快速看了一眼。

首先,尝试 Pastie.org 并粘贴插件源。我认为如果人们必须下载插件才能查看源代码,那么您得到的答案将会少得多。我快速浏览了一下,您所做的更改似乎很合理。

请参阅第 59 行,其中使用 wp_schedule_event 安排备份。这基本上是说,获取从管理表单传入的值并按此计划进行备份。如果这不起作用,请安装 Fiddler 并在保存更改时检查从插件发送的发布数据。您应该会看到新的“often”选项进入。如果它被传入,但仍未运行,则查看钩子 s3-backup (第三个参数)。那里肯定出了什么问题。

祝你好运。

I took a quick look.

To start, try pastie.org and paste source of plugin. I think you are going to get far fewer answers if people have to go download the plugin to view the source. I took a quick look and the changes you made seem reasonable.

See line 59 where the backup is scheduled using wp_schedule_event. This basically says, take the value passed in from the admin form and backup on this schedule. If this isn't working then install Fiddler and check the post data getting sent from the plugin when you save your changes. You should see your new 'often' option going in. If it is being passed in, but still not running then look at the hook s3-backup (third param). Something must be going wrong in there.

Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文