How to use "cron" to create scheduled task

Minimum time cycle: 1 minute

Use crontab -e edit scheduled task

25     10      *   *    * (/bin/bash /your/scripts/dir/test.sh)

If user Environment Variable need to be used, you need add . /etc/profile and . ~/.bash_profile in your scripts:

test.sh

#!/bin/bash
. /etc/profile
. ~/.bash_profile

Import user's Environment path into Linux cron task的更多相关文章

  1. How to set JAVA environment variables in Linux or CentOS

    How to set JAVA environment variables JAVA_HOME and PATH in Linux After installing new java (jdk or ...

  2. How to locate a path? - Unix & Linux Stack Exchange

    How to locate a path? - Unix & Linux Stack Exchange http://unix.stackexchange.com/questions/2955 ...

  3. Unable to write inside TEMP environment path

    安装PostgreSQL 9:Unable to write inside TEMP environment path 注册表:regedit HKEY_CLASSES_ROOT\.vbs,设置默认为 ...

  4. Linux - cron - cron 表达式

    概述 之前 cron 的补充 这次介绍下 表达式 背景 之前有说过 cron 这次说下 表达式 1. 准备 环境 os centos7 2. 模板文件 文件 位置 /etc/crontab 作用 系统 ...

  5. Linux - cron - 基础

    概述 cron 相关的理解与使用 背景 最近实在没啥写的了 我写东西, 一般是是这些 看了书过后, 做一些系统的整理 比如之前的 docker 和 git 系列 遇到了实际问题, 解决过程也不是那么顺 ...

  6. linux cron计划任务、chkconfig 命令、systemd命令、unit 相关、target 相关

    1.设置说明位置 : cat /etc/crontab # Example of job definition:# .---------------- minute (0 - 59)# | .---- ...

  7. python import package at different path

    1.导入上一级目录的package import sys sys.path.append('..') import <package> # import package at ../ 2. ...

  8. add environment path to powershell

    https://4sysops.com/archives/use-powershell-to-execute-an-exe/ https://stackoverflow.com/questions/7 ...

  9. Linux Cron 定时任务

    作者:丁仪 来源:https://chengxuzhixin.com/blog/post/LinuxCron-ding-shi-ren-wu.html 定时任务是经常被用到的,比如系统备份.数据导出等 ...

随机推荐

  1. bzoj3698

    显然是有源有汇有下界最大流,不刷不知道,一刷吓一跳发现了我之前求有源有汇有下界最大流的错误,具体见我那篇介绍有下界的网络流的解题报告(bzoj2502),已经更正 ; type node=record ...

  2. c#浅谈反射内存的处理

    这段时间由于公司的项目的要求,我利用c#的反射的机制做了一个客户端框架.客户端里的所有的模块都是以一定形式进行提供,例如:FORM,UserControl. 在做的过程中很简单与愉快.具体的过程如下: ...

  3. [Andrew]Ext.Net常用布局(Border布局)

    @(Html.X().Window().Width(600).Height(400).Layout(LayoutType.Border) .Items(p => {     p.Add(Html ...

  4. nyoj 括号匹配

    这个方程有两种形式,本文采用 if(s[i]=s[j]) dp[i][j]=d[i-1][j-1]   dp[i][j]=min(dp[i][k]+dp[k+1][j],dp[i][j]) (i=&l ...

  5. scp 详细总结

    转自:http://www.ha97.com/4169.html scp命令跟cp命令类似,只不过cp命令是在同一台机器上用的,scp是在两台机器上复制传输数据的命令.scp实质相当于利用SSH协议来 ...

  6. vijosP1413 Valentine’s Present

    vijosP1413 Valentine’s Present 链接:https://vijos.org/p/1413 [思路] 组合公式. 由题目知:每个箱子中的蛋糕要么与箱子颜色相同,要么指向一个蛋 ...

  7. Hadoop学习记录(2)|HDFS shell命令|体系结构

    HDFS的shell 调用文件系统(FS)shell命令使用hadoop fs的形式 所有的FS shell命令使用URI路径作为参数. URI格式是scheme://authority/path.H ...

  8. HW2.9

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  9. 在浏览器中使用jquery取得iframe中页面中指定元素的值的不同

    自己使用aspx页面中嵌套了ascx的页面其中使用了iframe的一些内容,出现了同一个页面的两种取值的方式 1. 在iframe的包含页面,需要使用iframe的页面中的元素,是需要使用$(wind ...

  10. win32键盘记录 -- 自定义窗口类

    最近学了些关于window api编程的知识,于是琢磨编写一些键盘记录器,能够把输入的按键输出到窗口内,并且实现窗口自动滚动. 封装窗口类使用了GWL_USERDATA字段来保存this指针,比较容易 ...