{"id":486,"date":"2023-01-31T11:51:04","date_gmt":"2023-01-31T11:51:04","guid":{"rendered":"https:\/\/blog1.tomtechproductions.be\/?p=486"},"modified":"2023-01-31T11:51:04","modified_gmt":"2023-01-31T11:51:04","slug":"backup-maken-van-bestanden-powershell","status":"publish","type":"post","link":"https:\/\/blog.tomtechproductions.be\/index.php\/2023\/01\/31\/backup-maken-van-bestanden-powershell\/","title":{"rendered":"Backup maken van bestanden powershell"},"content":{"rendered":"\n<p>Mount ssh shares as drives https:\/\/sftptogo.com\/blog\/how-to-map-sftp-as-a-windows-10-drive\/ <\/p>\n\n\n\n<p>Filestructure<\/p>\n\n\n\n<p>\/bu &lt;&#8211; root folder<br>\/bu\/database &lt;&#8211; databases<br>\/bu\/server &lt;&#8211; files<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>## Copy files\n$Source = \"Z:\\bu\\\"\n$Destination = \"P:\\Backups\\Server\\pluto01_versio\\\"\n\nGet-ChildItem $Source -Recurse | ForEach {\n    $ModifiedDestination = $($_.FullName).Replace(\"$Source\",\"$Destination\")\n    If ((Test-Path $ModifiedDestination) -eq $False) {\n        Copy-Item $_.FullName $ModifiedDestination\n    }\n}\n\n## Remove stale files\nGet-ChildItem \u2013Path \"P:\\Backups\\Server\\pluto01_versio\\database\" -Recurse | Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-30))} | Remove-Item\nGet-ChildItem \u2013Path \"P:\\Backups\\Server\\pluto01_versio\\server\" -Recurse | Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-30))} | Remove-Item<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Mount ssh shares as drives https:\/\/sftptogo.com\/blog\/how-to-map-sftp-as-a-windows-10-drive\/ Filestructure \/bu &lt;&#8211; root folder\/bu\/database &lt;&#8211; databases\/bu\/server &lt;&#8211; files<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,7],"tags":[],"class_list":["post-486","post","type-post","status-publish","format-standard","hentry","category-backup","category-windows"],"_links":{"self":[{"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/posts\/486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/comments?post=486"}],"version-history":[{"count":0,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/posts\/486\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/media?parent=486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/categories?post=486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/tags?post=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}