sebastianfeldmann / phpbu

PHP Backup Utility - Creates and encrypts database and file backups, syncs your backups to other servers or cloud services and assists you monitor your backup process
https://phpbu.de
Other
1.3k stars 110 forks source link

Does remote cleanup depend on local? #299

Closed anik1ng closed 3 years ago

anik1ng commented 3 years ago

Look my sample config:

<?xml version="1.0" encoding="UTF-8"?>
<phpbu xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="http://schema.phpbu.de/6.0/phpbu.xsd"
 verbose="true">
 <backups>
  <backup name="site.com">
    <source type="tar">
      <option name="path" value="/public_html"/>
    </source>
    <target dirname=".backup/site.com" filename="site.com-%Y%m%d-%H%i.tar"/>
    <sync type="sftp">
      <option name="host" value="***"/>
      <option name="port" value="22"/>
      <option name="user" value="***"/>
      <option name="password" value="***"/>
      <option name="path" value="/site.com"/>
      <option name="passive" value="true"/>
      <option name="cleanup.type" value="stepwise"/>
      <option name="cleanup.daysToKeepAll" value="30"/>
      <option name="cleanup.daysToKeepDaily" value="30"/>
      <option name="cleanup.weeksToKeepWeekly" value="4"/>
      <option name="cleanup.monthToKeepMonthly" value="12"/>
      <option name="cleanup.yearsToKeepYearly" value="50"/>
    </sync>
    <cleanup type="outdated">
      <option name="older" value="2d"/>
    </cleanup>
  </backup>
  </backup>
</backups>
</phpbu>

I want to store 2 copies locally, and use stepwise all remotely. It's possible?

anik1ng commented 3 years ago

And some question — i want store 1 every day copy for last 30 days, 12 month copies for every month, and unlimited years copies for every year.

<option name="cleanup.daysToKeepAll" value="0"/>
<option name="cleanup.daysToKeepDaily" value="30"/>
<option name="cleanup.weeksToKeepWeekly" value="0"/>
<option name="cleanup.monthToKeepMonthly" value="12"/>
<option name="cleanup.yearsToKeepYearly" value="50"/>

This is right config? :)

sebastianfeldmann commented 3 years ago

The remote cleanup works independently from your local files. Your first example should work though.

There is no option for unlimited years, but I think you are getting close by choosing 50 ;)