投稿時間:2022-08-15 08:10:54 RSSフィード2022-08-15 08:00 分まとめ(13件)
カテゴリー等 | サイト名等 | 記事タイトル・トレンドワード等 | リンクURL | 頻出ワード・要約等/検索ボリューム | 登録日 |
---|---|---|---|---|---|
IT | ITmedia 総合記事一覧 | [ITmedia ビジネスオンライン] 10年連続売り上げアップ ”甘くない”が「午後の紅茶」の定番商品になった理由 | https://www.itmedia.co.jp/business/articles/2208/15/news034.html | itmedia | 2022-08-15 07:15:00 |
IT | ITmedia 総合記事一覧 | [ITmedia エグゼクティブ] 第4回 部下の仕事の生産性を高める | https://mag.executive.itmedia.co.jp/executive/articles/2208/15/news003.html | itmedia | 2022-08-15 07:04:00 |
AWS | AWSタグが付けられた新着投稿 - Qiita | 【AWS】あるIAMロールに別のロールを引き受けられる(AssumeRole)ように設定する | https://qiita.com/cgshimo/items/a9cfa78ea8ca98f30b0b | assumerole | 2022-08-15 07:36:25 |
海外TECH | DEV Community | Automated Backups with cron and RClone | https://dev.to/itsbetma/automated-backups-with-cron-and-rclone-3do4 | Automated Backups with cron and RCloneThis article will show you how to use RClone and cron to automated file backups in a Linux Operating System It is Friday past PM and I needed to back up some work and school files to Google Drive Yes I use git for coding projects but this kind of work is better kept in Google Drive So I wonder if there was a quicker simple and automated way of doing backups to Google Drive and interesting I found RClone In this article you will learn Whats is RClone What is cron Basic usage of RClone and cron How to automatically back up files every Friday at PM Cron logging How to uninstall RClone Whats is RClone Basically RClone is a command line computer program that can manage transfer and sync files from your computer to cloud storage or even between two cloud storages Whats is cron Cron is a command line utility software with the main purpose of scheduling jobs Jobs are cron command with two parts basically the first one is the schedule expression the last is the script to be executed Usually all Linux OS comes with cron installed if not CentOS RHEL yum install cronieUbuntuapt get install cronWith cron you can schedule a command or a shell script to run at a specific time and that is what we going to do Schedule an RClone command to run every Friday at PM Setting up RCloneTo start install RClone For Linux macOS and BSD just run curl sudo bashAfter installing RClone let s run the RClone configuration command rclone configHere you will follow these steps Choose n for a New remote Type the name of the new RClone config for example mygdrive Type to use Google Drive as remote storage For the next two steps just type enter to continue Now choose for full access For the next two choices just type enter to continue Sign in into your google account in the RClone popup Now you are ready to go Building a shell script to backup files to Google DriveWe are going to build a shell script that contains RClone command lines to sync folders from my computer to the Google Drive storage Open your terminal and type mkdir sh cd shYou don t need to create a sh folder in your HOME directory you can create in another place or even do not create but it is a good idea to organize your scripts in one place If you create in another place just remind yourself to change the path in the next steps Now if you want to use vim then vim backup shBut if you want to use another text editor just create a file named backup sh in the HOME sh folder or any other place but HOME sh will be my location for this article With the backup sh file opened let s write a line of code that syncs a folder from my computer to the Google Drive storage rclone sync v create empty src dirs HOME Desktop Work mygdrive WorkNow let s dive into the explanations of the command rclone syncSync will copy the files from the source and send them to the destination but will not modify the source only the destination create empty src dirsBy default empty folders in the source are not synced so to work around this flag creates empty folders in the destination In the last part of the command you have two paths separated by a space the first one is the source path and the second one is the destination path By now you should probably notice that the second path has a mygdrive which is the same name as the rclone config name So basically I am syncing data from my computer to Google Drive using mygdrive configuration You can have multiple RClone configurations and this allows you to sync or copy files not just from your computer to the cloud but from one cloud to another Just like this rclone sync v create empty src dirs mygdrive Work anothergdrive WorkTo see if the backup sh file works just run the command below and check if the destination has changed source backup shAfter backup sh working properly let s understand how we can schedule the backup sh to run every day Final script rclone sync v create empty src dirs HOME Desktop Work mygdrive Workrclone sync v create empty src dirs HOME Desktop School mygdrive School Setting up cron to run Shell fileTo schedule any job in cron we need to edit the crontab file and to edit this file open your terminal and type crontab eIf you never used crontab then you will have to choose a default text editor in my case it is vim It will open the crontab file with your default text editor When the file is open you will see only comments To schedule in cron you will need a specific type of expression Below you will see the structure of the expression minute hour day of month month OR jan feb mar apr day of week Sunday or OR sun mon tue wed command to be executedExamples ーExpression to schedule a job my shell sh to run every Monday at AM is my shell shIf you want to run a job my shell sh from Monday to Friday at AM you can write my shell shMore examples of expressions gt Every hour gt Every two minutes gt At minute past every hour from through For more examples or to test if your expression will return the same logic as you expect go to crontab for more information With the crontab file open type the line below HOME sh backup shWhat this command does is every Friday at PM backup sh will be called and it will back up my files to Google Drive Tips ーWhere is the cron log file By default the cron log file is located at var log syslogAnd to see the cron log in this file run the code below grep CRON var log syslogor to continuously watch the file tail f var log syslog grep CRONThis command will return something like this Dec rainbowone CRON root CMD command v debian sa gt dev null amp amp debian sa Dec rainbowone CRON root CMD command v debian sa gt dev null amp amp debian sa Dec rainbowone CRON root CMD command v debian sa gt dev null amp amp debian sa Dec rainbowone CRON rainbow CMD HOME Desktop sh daily sh These messages only show which command cron ran if you want to see the backup sh log you will need to personalize the backup sh to create its own log file and write the content of it But assuming you want to log the cron message to a specific file luck of yours I will show you how First of all open this file etc rsyslog d default confUncomment the line that starts with cron and then restart syslog with sudo service rsyslog restartAfter that you will see cron logs in var log cron log and var log syslog How to uninstall RClone It is very simple to uninstall RClone from a Linux operating system first of all let s find where the rclone configuration file is to find the file run the command below rclone config fileIt will list one or more RClone configuration paths Configuration file is stored at home USER config rclone rclone confTo remove the configuration file sudo rm rf home USER config rclone rclone confAnd to finally remove RClone form the system sudo rm usr bin rclonesudo rm usr local share man man rclone At this point you are probably able to automate file backups with cron and RClone in a Linux operating system If you like this article you can give a ️ and for later in the save button And if you like content about Git Linux Productivity tips Typescript and Python please follow me Marco Antonio Bet itsbetma CronAndRCloneTutorial Repository for the How to use RClone and cron to automate backup in Linux CronAndRCloneTutorial View on GitHub | 2022-08-14 22:06:53 |
Cisco | Cisco Blog | Developing our future talent by engaging in solving real world challenges | https://blogs.cisco.com/education/three-students-from-australias-la-trobe-university-were-given-the-academic-and-industry-support-a-tight-timeframe-and-a-supervisor-to-come-up-with-a-digital-solution-for-our-health-sector | Developing our future talent by engaging in solving real world challengesThree students from Australia s La Trobe University were given the academic and industry support a tight timeframe and a supervisor to come up with a digital solution for our health sector | 2022-08-14 22:35:55 |
ニュース | BBC News - Home | Marshall Islands: Covid-19 cases surge | https://www.bbc.co.uk/news/world-asia-62544116?at_medium=RSS&at_campaign=KARANGA | marshall | 2022-08-14 22:32:47 |
ビジネス | ダイヤモンド・オンライン - 新着記事 | 米議員団が台湾訪問、蔡総統と会談へ - WSJ発 | https://diamond.jp/articles/-/308079 | 議員団 | 2022-08-15 07:27:00 |
北海道 | 北海道新聞 | バスラットレオンは7着 仏競馬のG1レース | https://www.hokkaido-np.co.jp/article/717733/ | 競馬 | 2022-08-15 07:36:02 |
北海道 | 北海道新聞 | 原口は後半25分まで出場 サッカーのドイツ1部 | https://www.hokkaido-np.co.jp/article/717758/ | 後半 | 2022-08-15 07:31:00 |
ビジネス | 東洋経済オンライン | 「年末の株高は不変」でも頭に入れておくべきこと 重要統計には「来年の株価下振れの兆し」がある | 市場観測 | 東洋経済オンライン | https://toyokeizai.net/articles/-/611268?utm_source=rss&utm_medium=http&utm_campaign=link_back | 東洋経済オンライン | 2022-08-15 07:30:00 |
ビジネス | プレジデントオンライン | 「自分は絶対しない」は勘違い…精神科医がどんなに穏やかな人でもあおり運転の可能性があると断言する理由 - プライベートな空間で理性が緩んでしまう | https://president.jp/articles/-/60419 | 精神科医 | 2022-08-15 08:00:00 |
ビジネス | プレジデントオンライン | 「自分は絶対しない」は勘違い…精神科医がどんなに穏やかな人でもあおり運転の可能性があると断言する理由 - プライベートな空間で理性が緩んでしまう | https://president.jp/articles/-/60386 | 精神科医 | 2022-08-15 08:00:00 |
ビジネス | プレジデントオンライン | 北海道と東北は共産国家になるはずだった…ロシアの「日本占領作戦」が実行されなかった間一髪の偶然 - あの時降伏しなければ、今の日本はなかった | https://president.jp/articles/-/60313 | 間一髪 | 2022-08-15 08:00:00 |
コメント
コメントを投稿