Eu criei o seguinte script de shell, que chamei de backup-ALL-AUDIO-AND-VIDEO :
#!/bin/bash
cd /home/y/ALL-AUDIO-AND-VIDEO/
find . -mtime -0.75 -type f -print0 | rsync -0v --files-from=- /home/y/ALL-AUDIO-AND-VIDEO /home/y/Backup-of-ALL-AUDIO-AND-VIDEO
Para executar o script manualmente, faço o seguinte:
sudo spacefm
Depois, clico duas vezes em backup-ALL-AUDIO-AND-VIDEO . E isso funciona corretamente.
Para executar automaticamente o script acima, eu corri:
sudo crontab -e
e criou este trabalho cron:
*/1 * * * * /etc/cron.weekly/backup-ALL-AUDIO-AND-VIDEO
mas não é executado. Por favor informar. (Claro, eu configurei o cron job para rodar a cada minuto apenas para fins de teste).
Eu pretendo usar o script para copiar somente os arquivos que eu mudei durante o período anterior de 18 horas para um diretório que será feito o backup manual no Google Drive. Estava demorando muito para fazer o backup de todo o diretório ALL-AUDIO-AND-VIDEO/ no Google Drive no final de cada dia.
O seguinte vem de /var/log/syslog . Eu cortei talvez 90% deste log porque era repetitivo.
Oct 7 09:48:34 y-Peppy anacron[679]: Job 'cron.daily' terminated
Oct 7 09:48:34 y-Peppy anacron[679]: Normal exit (1 job run)
Oct 7 09:49:01 y-Peppy CRON[3542]: (root) CMD (/etc/cron.weekly/backup-ALL-AUDIO-AND-VIDEO)
Oct 7 09:49:01 y-Peppy cron[683]: Please install an MTA on this system if you want to use sendmail!
Oct 7 09:49:01 y-Peppy CRON[3541]: (root) MAIL (mailed 70 bytes of output but got status 0x00ff from MTA#012)
Oct 7 09:49:01 y-Peppy CRON[3545]: (y) CMD (/home/y/Scripts/Lock-screen)
Oct 7 09:49:01 y-Peppy cron[683]: Please install an MTA on this system if you want to use sendmail!
Oct 7 09:49:01 y-Peppy CRON[3540]: (y) MAIL (mailed 51 bytes of output but got status 0x00ff from MTA#012)
Oct 7 09:50:01 y-Peppy CRON[3621]: (y) CMD (/home/y/Scripts/Lock-screen)
Oct 7 09:50:01 y-Peppy CRON[3622]: (root) CMD (/etc/cron.weekly/backup-ALL-AUDIO-AND-VIDEO)
Oct 7 09:50:01 y-Peppy cron[683]: Please install an MTA on this system if you want to use sendmail!
Oct 7 09:50:01 y-Peppy CRON[3619]: (y) MAIL (mailed 51 bytes of output but got status 0x00ff from MTA#012)
Oct 7 09:50:01 y-Peppy cron[683]: Please install an MTA on this system if you want to use sendmail!
Oct 7 09:50:01 y-Peppy CRON[3620]: (root) MAIL (mailed 70 bytes of output but got status 0x00ff from MTA#012)
Oct 7 09:51:01 y-Peppy CRON[3690]: (root) CMD (/etc/cron.weekly/backup-ALL-AUDIO-AND-VIDEO)
[I cut out perhaps 90% of this log because it was repetitive]
Oct 7 14:40:01 y-Peppy CRON[13981]: (y) CMD (/home/y/Scripts/Lock-screen)
Oct 7 14:40:01 y-Peppy cron[683]: Please install an MTA on this system if you want to use sendmail!
Oct 7 14:40:01 y-Peppy cron[683]: Please install an MTA on this system if you want to use sendmail!
Oct 7 14:40:01 y-Peppy CRON[13978]: (y) MAIL (mailed 51 bytes of output but got status 0x00ff from MTA#012)
Oct 7 14:40:01 y-Peppy CRON[13979]: (root) MAIL (mailed 70 bytes of output but got status 0x00ff from MTA#012)
Oct 7 14:40:29 y-Peppy org.gtk.vfs.AfcVolumeMonitor[8438]: Volume monitor alive
Oct 7 14:40:51 y-Peppy dbus[697]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Oct 7 14:40:51 y-Peppy systemd[1]: Starting Hostname Service...
Oct 7 14:40:51 y-Peppy dbus[697]: [system] Successfully activated service 'org.freedesktop.hostname1'
Oct 7 14:40:51 y-Peppy systemd[1]: Started Hostname Service.
Oct 7 14:40:57 y-Peppy systemd[1]: Started CUPS Scheduler.
O seguinte vem de /var/log/auth.og . Eu cortei talvez 90% deste log porque era repetitivo.
Oct 2 12:12:22 y-Peppy systemd-logind[798]: Power key pressed.
Oct 2 12:12:50 y-Peppy systemd-logind[798]: Power key pressed.
Oct 2 12:15:00 y-Peppy systemd-logind[798]: message repeated 3 times: [ Power key pressed.]
Oct 2 12:17:01 y-Peppy CRON[5443]: pam_unix(cron:session): session opened for user root by (uid=0)
Oct 2 12:17:01 y-Peppy CRON[5443]: pam_unix(cron:session): session closed for user root
Oct 2 12:20:50 y-Peppy polkitd(authority=local): Operator of unix-session:1 successfully authenticated as unix-user:y to gain ONE-SHOT authorization for action com.ubuntu.pkexec.synaptic for unix-process:5607:283581 [/bin/sh /usr/bin/synaptic-pkexec] (owned by unix-user:y)
Oct 2 12:20:50 y-Peppy pkexec: pam_unix(polkit-1:session): session opened for user root by (uid=1000)
Oct 2 12:20:50 y-Peppy pkexec: pam_systemd(polkit-1:session): Cannot create session: Already running in a session
Oct 2 12:20:50 y-Peppy pkexec[5608]: y: Executing command [USER=root] [TTY=unknown] [CWD=/home/y] [COMMAND=/usr/sbin/synaptic]
Oct 2 12:21:22 y-Peppy groupadd[7626]: group added to /etc/group: name=ssh, GID=126
Oct 2 12:21:22 y-Peppy groupadd[7626]: group added to /etc/gshadow: name=ssh
Oct 2 12:21:22 y-Peppy groupadd[7626]: new group: name=ssh, GID=126
Oct 2 12:27:21 y-Peppy systemd-logind[798]: Power key pressed.
Oct 2 12:35:41 y-Peppy systemd-logind[798]: Power key pressed.
Oct 2 12:43:49 y-Peppy systemd-logind[798]: Power key pressed.
Oct 2 12:45:20 y-Peppy systemd-logind[798]: Power key pressed.
Oct 2 12:45:39 y-Peppy systemd-logind[798]: Power key pressed.
Oct 7 14:58:01 y-Peppy CRON[14624]: pam_unix(cron:session): session opened for user root by (uid=0)
Oct 7 14:58:01 y-Peppy CRON[14623]: pam_unix(cron:session): session opened for user y by (uid=0)
Oct 7 14:58:01 y-Peppy CRON[14623]: pam_unix(cron:session): session closed for user y
Oct 7 14:58:01 y-Peppy CRON[14624]: pam_unix(cron:session): session closed for user root
O seguinte vem de /var/log/syslog1 . Eu cortei talvez 90% deste log porque era repetitivo.
Oct 7 09:48:01 y-Peppy CRON[3076]: (root) CMD (/etc/cron.weekly/backup-ALL-AUDIO-AND-VIDEO)
Oct 7 09:48:01 y-Peppy cron[683]: Please install an MTA on this system if you want to use sendmail!
Oct 7 09:48:01 y-Peppy CRON[3072]: (root) MAIL (mailed 70 bytes of output but got status 0x00ff from MTA#012)
Oct 7 09:48:31 y-Peppy anacron[679]: Job 'cron.daily' started
Oct 7 09:48:31 y-Peppy anacron[3182]: Updated timestamp for job 'cron.daily' to 2016-10-07
Oct 7 09:48:31 y-Peppy systemd[1]: Stopping Make remote CUPS printers available locally...
Oct 7 09:48:31 y-Peppy systemd[1]: Stopped Make remote CUPS printers available locally.
Oct 7 09:48:31 y-Peppy systemd[1]: Stopping CUPS Scheduler...
Oct 7 09:48:31 y-Peppy systemd[1]: Stopped CUPS Scheduler.
Oct 7 09:48:31 y-Peppy systemd[1]: Started CUPS Scheduler.
Oct 7 09:48:31 y-Peppy systemd[1]: Started Make remote CUPS printers available locally.
Oct 7 09:48:32 y-Peppy rsyslogd: [origin software="rsyslogd" swVersion="8.16.0" x-pid="692" x-info="http:/www.rsyslog.com"] rsyslogd was HUPed