kbond / ZenstruckBackupBundle

Symfony2 Bundle that wraps backup commands
http://zenstruck.com/projects/ZenstruckBackupBundle
MIT License
17 stars 3 forks source link

Timezone support in namers #5

Closed kachkaev closed 9 years ago

kachkaev commented 9 years ago

The timestamps in the names of the shapshots use the time zone of the server. It can be handy, however, to use some other one, e.g UTC:

#...
    namers:
        snapshot:
            timestamp:
                format: Y-m-d-Hi
                prefix: my-backup-
                timezone_identifier: UTC
                # or:
                timezone_offset: +0000
kbond commented 9 years ago

@kachkaev does #6 do what you'd like?

kachkaev commented 9 years ago

Thank you, this nearly works. There's just a need to add the third argument in services.yml as well:

<service id="zenstruck_backup.namer.abstract_timestamp" class="Zenstruck\BackupBundle\Namer\TimestampNamer" abstract="true" public="false">
            <argument /> <!-- format -->
            <argument /> <!-- prefix -->
            <argument /> <!-- timezone -->
        </service>

An exception is thrown otherwise.

kbond commented 9 years ago

Thanks, made that change.

kachkaev commented 9 years ago

Thanks! All works now.