Este sitio web funciona mejor con JavaScript.
Inicio
Explorar
Ayuda
Iniciar sesión
leiyun
/
crontab_backup
Seguir
1
Destacar
0
Fork
0
Código
Incidencias
0
Pull Requests
0
Lanzamientos
0
Wiki
Actividad
Explorar el Código
crontab备份
master
姚子军
hace 3 años
padre
acaf6b95e6
commit
27c5ff4ef6
Se han
modificado 2 ficheros
con
18 adiciones
y
0 borrados
Dividir vista
Opciones de diferencias
Mostrar estadísticas
Descargar archivo de parche
Descargar archivo de diferencias
+9
-0
backup.sh
+9
-0
gitrun.sh
+ 9
- 0
backup.sh
Ver fichero
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
BACKUP_DIRECTORY="/home/crontab_backup"
if [ ! -e "${BACKUP_DIRECTORY}" ]; then
mkdir -p ${BACKUP_DIRECTORY}
fi
crontab -l > ${BACKUP_DIRECTORY}/$(date '+%Y%m%d%H%M%S').txt
+ 9
- 0
gitrun.sh
Ver fichero
@@ -0,0 +1,9 @@
在root目录下创建run.sh脚本
vim run.sh
# 文件内容如下
#!/bin/sh
cd /home/crontab_backup
git add .
git commit -m "crontab备份"
git push
# 保存
Escribir
Vista previa
Cargando…
Cancelar
Guardar