title: How to enable cron backup in docker gitlab-ce
body: <p>I am using <a href="https://hub.docker.com/r/gitlab/gitlab-ce/" rel="noreferrer">this</a> Docker image to install <code>gitlab-ce</code></p>
  
  <p>To configure it, you can override a file called <code>gitlab.rb</code> by mounting it as  a volume at <code>./gitlab.rb:/etc/gitlab/gitlab.rb:ro</code></p>
  
  <p>You can find gitlab.rb <a href="https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template" rel="noreferrer">here</a></p>
  
  <p>At the backup section I currently have this : </p>
  
  <pre><code>## For setting up backups
  ## see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#backups
  
  # gitlab_rails['manage_backup_path'] = true
  # gitlab_rails['backup_path'] = "/var/opt/gitlab/backups"
  gitlab_rails['backup_archive_permissions'] = 0644 # See: http://doc.gitlab.com/ce/raketasks/backup_restore.html#backup-archive-permissions
  # gitlab_rails['backup_pg_schema'] = 'public'
  gitlab_rails['backup_keep_time'] = 604800
  # gitlab_rails['backup_upload_connection'] = {
  #   'provider' =&gt; 'AWS',
  #   'region' =&gt; 'eu-west-1',
  #   'aws_access_key_id' =&gt; 'AKIAKIAKI',
  #   'aws_secret_access_key' =&gt; 'secret123'
  # }
  # gitlab_rails['backup_upload_remote_directory'] = 'my.s3.bucket'
  # gitlab_rails['backup_multipart_chunk_size'] = 104857600
  # gitlab_rails['backup_encryption'] = 'AES256' # Turns on AWS Server-Side Encryption with Amazon S3-Managed Keys for backups
  </code></pre>
  
  <p>If you see as recommended in the code this <a href="https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/README.md#backups" rel="noreferrer">link</a>, it says :</p>
  
  <pre><code># Scheduling a backup
  
  To schedule a cron job that backs up your repositories and GitLab metadata, use the root user:
      sudo su -
      crontab -e
  There, add the following line to schedule the backup for everyday at 2 AM:
      0 2 * * * /opt/gitlab/bin/gitlab-rake gitlab:backup:create
  </code></pre>
  
  <h1>Questions</h1>
  
  <ul>
  <li>Is there a way to do this at the installation instead of doing it manually ? </li>
  <li>Is the cron task already running ? Should we not start it by doing <code>crontab -f</code> ?</li>
  <li>What file does the command <code>crontab -e</code> modify ? </li>
  <li>To change the manual configuration part of the tutorial, with a cron file like <code>/etc/cron.d/my-backup-cron</code> will it be the same expected behavior ?</li>
  </ul>