[Nix-dev] cron job to backup a database as part of the configuration.nix file

2015-05-28 Thread stewart mackenzie
Hello,

So we've written a database bash backup script for a database running on nixos.
The idea is to configure cron via configuration.nix to execute this script.

Ideally we'ed like the actual backup script to be part of the
configuration.nix file
which then is used in the cron job.

What is the Nix Way to resolve this issue?

/sjm
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] cron job to backup a database as part of the configuration.nix file

2015-05-28 Thread Marc Weber
1) writeScriptBin (see samples in nixpkgs)
2)  services.cron.systemCronJobs = ...

Marc
___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


Re: [Nix-dev] cron job to backup a database as part of the configuration.nix file

2015-05-28 Thread Peter Simons
Stewart Mackenzie writes:

  Ideally we'ed like the actual backup script to be part of the
  configuration.nix file which then is used in the cron job.

  services.cron.systemCronJobs = [
30 */3 * * * root backup-script.sh
  ];

Best regards,
Peter

___
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev