~teejee2008/timeshift/trunk

« back to all changes in this revision

Viewing changes to src/Utility/CronTab.vala

  • Committer: Tony George
  • Date: 2017-01-26 08:19:58 UTC
  • Revision ID: tony.george.kol@gmail.com-20170126081958-zp5n5c6r3ach25sj
Fixed: Hourly task was not created correctly; Schedule Window: Updated messages to avoid confusion;

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
        }
269
269
 
270
270
        public static bool add_script_file(string file_name, string cron_dir_type, string text, bool stop_cron_emails){
 
271
                
 
272
                /* Note:
 
273
                 * cron.d and cron.hourly are managed by cron so it expects entries in crontab format
 
274
                 * minute hour day_of_month month day_of_week user command
 
275
                 * 
 
276
                 * cron.{daily|weekly|monthly} are read by anacron. scripts placed here should have commands only.
 
277
                 * */
271
278
 
272
279
                switch (cron_dir_type){
273
280
                case "d":
286
293
                string file_path = "/etc/cron.%s/%s".printf(cron_dir_type, file_name.replace(".","-")); // dot is not allowed in file name
287
294
 
288
295
                string sh = "";
289
 
                sh += "SHELL=/bin/sh" + "\n";
 
296
                sh += "SHELL=/bin/bash" + "\n";
290
297
                sh += "PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" + "\n";
291
298
                if (stop_cron_emails){
292
299
                        sh += "MAILTO=\"\"" + "\n";